Frank Jaegar🦾🦊
03/18/2025, 10:57 PMJonas
03/19/2025, 12:58 AMFrank Jaegar🦾🦊
03/20/2025, 8:59 AMShubham Bajaj
03/22/2025, 3:57 AM{{now}}, {{date}}, {{time}}, etc.).
To handle specific timezones, you can use the date filter with a timezone parameter:
{{ "now" | date: "%b %d, %Y, %I:%M %p", "America/New_York" }}
### 2. Passing Date/Time from N8N to VAPI
When sending data from N8N to VAPI, you should:
1. **Format the date in N8N**: Ensure your N8N workflow outputs dates in a consistent format (ISO 8601 is recommended: YYYY-MM-DDTHH:mm:ss.sssZ)
2. **Pass the date to VAPI**: In your N8N-to-VAPI integration, set up the variable values:
json
{
"assistantId": "your-assistant-id",
"assistantOverrides": {
"variableValues": {
"appointmentDate": "2024-03-15T14:30:00.000Z" // Example date from N8N
}
},
"customer": {
"number": "+1xxxxxxxxxx"
},
"phoneNumberId": "your-phone-id"
}
3. **Use timezone formatting in VAPI**: In your VAPI assistant message templates, use the date filter with the appropriate timezone:
Your appointment is scheduled for {{ appointmentDate | date: "%b %d, %Y at %I:%M %p", "America/Los_Angeles" }}
### 3. Handling Different Timezones for Different Users
If you need to support users in different timezones:
1. **Store user timezone in N8N**: Keep the user's timezone preference in your database
2. **Pass timezone as a variable**: Send both the date and the timezone as variables:
json
{
"assistantOverrides": {
"variableValues": {
"appointmentDate": "2024-03-15T14:30:00.000Z",
"userTimezone": "America/Chicago"
}
}
}
3. **Use the dynamic timezone in VAPI**:
Your appointment is scheduled for {{ appointmentDate | date: "%b %d, %Y at %I:%M %p", userTimezone }}
### 4. Debugging Tips
If you're still experiencing issues:
1. **Verify N8N output format**: Ensure N8N is outputting dates in a consistent, standard format
2. **Log the variables**: Add debug logging to verify what VAPI is receiving
3. **Test with static values**: Try hardcoding values first to verify your template works
4. **Check timezone names**: Ensure you're using valid IANA timezone names (e.g., "America/New_York", not "EST")Frank Jaegar🦾🦊
03/22/2025, 4:01 AM