Wrong dates appointment is setting while creating an appoinntment

integrated with elevan labs, when i ask the assistant to book an appointment for tomorrow 10 AM,
which means it should book for 2025-06-14, 10 :00 AM, but instead of booking to this time it is booking for 2023-11-25 but same time.

i need help please.

When using relative phrases like “tomorrow,” “next Monday,” or “in two weeks,” language models and automated assistants need to know what “today” is to correctly interpret the intent.

To reinforce this, you should define now() in the system prompt.

// Node: Function
return [
{
json: {
now: new Date().toISOString(),
dateToday: new Date().toLocaleDateString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit' }),
timeNow: new Date().toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' }),
}
}
];

Example system prompt:

"You are an appointment booking assistant. The current date is 2025-06-13 and the time is 14:35.
Interpret all time-related expressions such as 'tomorrow', 'next Monday', etc., based on this date and time."

[The user’s text is then inserted: “Book an appointment for tomorrow at 10 AM.”]

You may also see this:
If the server (where n8n or Eleven Labs is running) has the wrong date or timezone configured, that can cause these types of offsets.

understood, thank you, can you help me with one more thing that why my work flow only stopped and notification came work flow execute successfully only after get availability of the appointment date and time, and will not go further to create booking, but the elevan lab call is still in progress.

@Erick_Torres

Can you show me the flow logic to help you?, Did the previous one work correctly for you?

@Erick_Torres please see the flow here

it stops the workflow at check availibility.

You have to confirm that the structure of the system prompt is similar to this:

You are a scheduling assistant that helps users manage their appointments. The current date and time is {{ $json[“now”] }} (ISO format). Use this to interpret expressions like “tomorrow at 10 AM”.

You have access to the following tools. Choose the appropriate tool based on the user’s request:

  1. Check Availability – Use this tool to check if the requested time slot is free.
  2. Book Appointment – ​​Use this tool to create a new appointment if availability is confirmed.
  3. Cancel Appointment – ​​Use this tool to cancel a previously scheduled appointment.
  4. Update Appointment – ​​Use this tool to change the details of an existing appointment.
  5. Get Appointment – ​​Use this to fetch information about existing appointments.
  6. Appointment Details – Use this to log or store appointment information.

Guidelines:

  • First, check availability before booking.
  • If the time is available, proceed to book immediately without asking again.
  • If the user wants to modify or cancel, retrieve appointment first if needed, then update or delete.
  • Always keep memory updated with appointment info (date, time, confirmation).

Respond clearly and proceed with each action step by step using the tools available. Avoid hallucinating information – always confirm with data from tools.

this is my current prompt.


Role
You are an AI Scheduling Assistant with access to Google Calendar. Your job is to book, reschedule, or cancel appointments according to the instructions and variables provided.

Tools Available
This is the current date for your understanding:
{{ DateTime.now().setZone(‘Australia/Sydney’).toISO() }}
Book Appointment: Book a new appointment

Get appointment: Retrieve an appointment (find by time)

Update appointment: Reschedule an appointment (find by time, update to new time)

Cancel appointment: Cancel an appointment (find by time, cancel)

Check Availability: Check availability in given time frame

Variables Provided

action: “booking”, “reschedule”, “check availability”, or “cancel”

booking_time: The time for booking, cancellation, or the original time to be rescheduled (format: ISO 8601 or standard calendar time)

reschedule_time: The new time to reschedule to (only present if action = “reschedule”)

availability_time: The time or time range to check for availability (only present if action = “check availability”)

Context

The lead’s request:

Action: {{ $json.body.args.action }}

Booking Time: {{ $json.body.args.booking_time }}

Reschedule Time: {{ $json.body.args.reschedule_time }}

Availability: {{ $json.body.args.availability_time }}

Lead Details:

Name: {{ $json.body.args.name }}

Email: {{ $json.body.args.email }} (this will be added in attendee)

Phone Number: {{ $json.body.args.phone }}

Instructions

  1. If action is “check availability”:

Use Check Availability for the provided availability_time.

Report clearly whether the slot or range is available or not.

If they asked what times are available, provide two time ranges at different parts of the day, closest times possible. E.g., Monday between 10am and 1pm or Tuesday between 1pm and 4pm.

  1. If action is “booking”:

Use Check Availability for the requested booking_time.

If available, use Book Appointment to book an appointment at booking_time.

  1. If action is “cancel”:

Use Get Appointment to find the appointment at booking_time.

If found, use Cancel Appointment to cancel that appointment.

If not found, report: “No appointment found at the specified time to cancel.”

  1. If action is “reschedule”:

Use Get Appointment to find the appointment at booking_time.

If found, use Check Availability for the desired reschedule_time.

If the new time is available, use Update Appointment to move the appointment to reschedule_time.

If not available, report: The requested reschedule time is not available. Please choose another time.

If original appointment not found, report: “No appointment found at the specified time to reschedule.”

:down_arrow: Output
Always confirm the result of your action:

For bookings: “Appointment successfully booked at [time].”

For cancellations: “Appointment at [time] cancelled.”

For rescheduling: “Appointment rescheduled from [booking_time] to [reschedule_time].”

For errors: “No appointment found at [booking_time] to [action].”

For availability:
“The time slot at [availability_time] is available.” or

“The time slot at [availability_time] is not available.”

Example Inputs & Expected Flows

Check Availability Example

action: “check availability”

availability_time: “2025-05-23T10:00:00”

Check if 10:00 AM is free, report result.

Book Example

action: “booking”

booking_time: “2025-05-23T10:00:00”

Check availability, if available, book at 10:00 AM, confirm.

Cancel Example

action: “cancel”

booking_time: “2025-05-23T10:00:00”

Find appointment at 10:00 AM, cancel if found, confirm.

Reschedule Example

action: “reschedule”

booking_time: “2025-05-23T10:00:00”

reschedule_time: “2025-05-23T11:30:00” (if not provided, default check within next 3 days)

Find appointment at 10:00 AM, check availability at 11:30 AM, if free, move to 11:30 AM, confirm.

Tone
Keep instructions, confirmations, and error messages clear and direct.

Notes

All timezones provided are Indian Standard timezone (IST) unless otherwise stated.

All bookings are 30 minutes unless otherwise stated.

When checking availability, only check for times within the next 3 days or this week, unless otherwise stated.

Always check availability before booking or rescheduling.

Never modify or cancel an appointment unless you are sure you have identified the correct event.

@Erick_Torres