Sleep for a duration
Callstep.sleep with a duration:
nelkap/workflows/send-trial-reminder.ts
Durations
A duration is a whole number and a unit, like30 seconds or 3 days. The unit can be singular or plural.
A month from January 31 runs past the end of February and ends in early March. A sleep lasts up to a year.
Wake-up time
Nelkap checks sleeping runs every minute, so a run resumes within a minute after its time is up. A sleep of a few seconds therefore lasts up to a minute. When the run wakes, Nelkap calls your app, and your workflow runs from its first line: the steps before the sleep return their saved results, the sleep returns at once, and the work after it runs.Sleep until a date
step.sleep takes a duration. To sleep until a date, work out the duration in a step, so every call of the run gets the same one:
0 hours, and the sleep returns at once, without pausing the run.
Sleep names
A sleep is saved like a step, named after its duration. When a run reaches two sleeps of1 day, the first matches the first saved one, and the second matches the second.
Errors
Like any error your workflow doesn’t catch, either one fails the run. Every code is described in Errors.