Add today's date to agent node
What's the easiest way to add today's date to an agent flow? Below is my flow.
I've tried to set up a variable however it is not working as expected.
I've also tried to add it as a function within the agent node itself without success.
If it's possible to add it without an extra code / function block that would be best. I need the date to generate the summary at the end of the conversation, and users can book times etc that I need to capture.
At the moment, for some reason, I am getting 'todays date as 30th Jan 2025' even though it's 28th Sep 2025 🙂

4 Replies
Here’s the quickest, no-API way to stamp “today’s date” into your agent and make sure it’s always correct:
1. Add a JavaScript step at the very start of your workflow (before any places where you’ll reference the date).
2. Inside the JS editor paste the snippet below – it populates an existing Voiceflow variable called
https://docs.voiceflow.com
date_today
(rename if you already have a different var).
3. From any Text, API or other step just reference {{date_today}}
.
Why you were seeing “30 Jan 2025”
• Voiceflow doesn’t ship a built-in current-date system variable, so if date_today
was set once during testing it’s stored in Memory and keeps coming back until you overwrite or reset the prototype. Adding the code above guarantees it’s refreshed every run.
• If you copied a formatting example like new Date(‘2025-01-30’)
that hard-coded value would obviously repeat – a dynamic new Date()
call avoids that.
No extra Function step?
A JavaScript step is lighter weight when you only need a few lines like this. A Function is great when you need to reuse or export it across projects, but for a single agent the JS step is perfect.
Need a different timezone or format?
Use toLocaleDateString()
with the locale/timezone options you need:
After you drop this step in you should see the correct 2025-09-28 (or whatever today is) every time. Happy building!https://docs.voiceflow.com
can you update the above javascript to use Brisbane, Australia timezone please.
code execution failed after I tried this javascript. To run it I just tested the javascript block. Is this the correct way to use it? The javascript block is currently not connected to any other node.



I've also tried this Javascript which has also come up with an execution code error: "// Very basic approach
const today = new Date().toLocaleDateString();
return {
brisbaneDate: today
};"