This is a great use case for workflows.

This is a great use case for workflows. I think that's the best way to achieve it currently. You can clean your code step a little bit to make it more straightforward if you want:
export const main = async () => {
return {
number: Date.now()
}
}
export const main = async () => {
return {
number: Date.now()
}
}
9 Replies
Absynth
Absynth•4mo ago
Hey! I just tested it to set an automated due date at the task creation but It's failing. I even tried with
export const main = async () => {
return {
dueAt: new Date().toISOString()
};
}
export const main = async () => {
return {
dueAt: new Date().toISOString()
};
}
but it's still failing. Do you have any idea? thanks!
Prastoin
Prastoin•4mo ago
Hey @Absynth what's failing exactly ?
Baptiste Devessier
Baptiste DevessierOP•4mo ago
It should work correctly. Could you provide more information about your setup and how you determine it's failing? Thanks.
Absynth
Absynth•4mo ago
the due date is not set but the test seems ok
{
"dueAt": "2025-07-03T09:48:58.139Z"
}
{
"dueAt": "2025-07-03T09:48:58.139Z"
}
I cannot see more, it's crashing twenty... (twenty is deployed in Raylway, v1.02)
No description
No description
No description
Baptiste Devessier
Baptiste DevessierOP•4mo ago
At the end of your GIF, an error is displayed. I bet the error is also printed in the console of your browser. Could you open the console in the devtools and search for the error? It seems to be a validation error. I can help you debug if I know more about what's incorrect.
No description
Absynth
Absynth•4mo ago
sorry... should have sent it before!
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"output",
"flow",
"steps",
1,
"settings",
"input",
"serverlessFunctionVersion"
],
"message": "Expected string, received null"
}
]
at get error (index--VWgrkAN.js:158:140927)
at p9 (index--VWgrkAN.js:5910:1840)
at nZt (index--VWgrkAN.js:5910:2401)
at wF (index--VWgrkAN.js:46:17885)
at MF (index--VWgrkAN.js:48:3173)
at Yee (index--VWgrkAN.js:48:45924)
at Hee (index--VWgrkAN.js:48:40687)
at U$e (index--VWgrkAN.js:48:40611)
at jk (index--VWgrkAN.js:48:40461)
at GF (index--VWgrkAN.js:48:36705)
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"output",
"flow",
"steps",
1,
"settings",
"input",
"serverlessFunctionVersion"
],
"message": "Expected string, received null"
}
]
at get error (index--VWgrkAN.js:158:140927)
at p9 (index--VWgrkAN.js:5910:1840)
at nZt (index--VWgrkAN.js:5910:2401)
at wF (index--VWgrkAN.js:46:17885)
at MF (index--VWgrkAN.js:48:3173)
at Yee (index--VWgrkAN.js:48:45924)
at Hee (index--VWgrkAN.js:48:40687)
at U$e (index--VWgrkAN.js:48:40611)
at jk (index--VWgrkAN.js:48:40461)
at GF (index--VWgrkAN.js:48:36705)
No description
Absynth
Absynth•4mo ago
No description
Baptiste Devessier
Baptiste DevessierOP•4mo ago
The error seems related to the serverless function. I would try deleting it from the flow and recreating it.
Absynth
Absynth•4mo ago
hum... I just deleted the workflow, created a new one again and did the same thing. by the end the outcome is exactly the same 😢

Did you find this page helpful?