run, Nelkap records the run, and your code moves on without waiting for the workflow.
Start a run
Callrun with the workflow function and its payload:
registerWorkflows.
run returns once Nelkap has recorded the run, with its ID. It doesn’t wait for the workflow to finish, so you can call it from a request handler and answer right away.
If Nelkap turns the run down, for example because the workflow isn’t registered, run throws a NelkapError that names the reason.
The payload
The payload is what the run works on. Nelkap passes it to your workflow as its only argument, on every call of the run:- It can be any JSON value: a string, a number, an object, or a list.
- It’s sent as JSON, so a
Datereaches your workflow as a string. - It shows on the run’s page, so you can see what each run worked on.
- Its size is limited by your plan. See Limits.
nelkap.run(sendDigest).
Keep the payload small, like an ID your workflow uses to load the rest. The run then works on the latest data, and every call carries less.
Tags
Tags label a run, so you can find it later. Filter your runs by tag, for example to see every run of a customer:When the run starts
A new run is pending until its turn comes. Nelkap starts pending runs every minute, so a run starts within a minute of being created, unless it waits for room under a concurrency limit.Start a run from a workflow
A workflow can start runs of other workflows, for example one for each item of a list. Callrun inside a step, so the new run starts once, even when the first run picks up again later:
Other ways to start a run
Your code knows exactly which workflow to start. When it doesn’t, or when the work comes from somewhere else, start runs another way:
A workflow can use several at once, and every workflow can be started from your code, whatever else starts it.