How to set the end time more flexibly?

I’m using a Google Calendar node, and I set the start time like this: {{ fromAI(‘Start’, ‘this is the start of time’, ‘string’) }}. Can the end time be set to default to 2 hours after the start time? What is a good way to achieve this? Can I reference the start time directly? Or should I write it in the prompt of the AI agent node?:

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Fu_Xiang hope all is good. Welcome to the community.

You can instruct your LLM to extract the end time from the message and if end time is not found in the message to set the end time to two hours after the start time. Then in the calendar node you use another fromAI() in the similar manner, to specify the end time. This way the node will always receive the end time from the LLM.

Thank you!