Start a run
Callnelkap.run with the workflow function and its payload:
app/signup.ts
- You pass the function itself, not its name. The SDK finds the name it was registered under, and TypeScript checks the payload against the workflow’s argument.
- The function must be one you passed to
registerWorkflows. Any other function throws an error. runreturns as soon as Nelkap has recorded the run, with its ID. It doesn’t wait for the workflow to finish, so a request handler can answer right away.
Payload
The payload is the argument your workflow receives. Its type comes from the workflow’s signature:nelkap.run(sendDigest). See Payload for its size limit and how it’s sent.
Tags
Tags label the run, so you can filter runs by them in the console, for example to see every run of a customer:Start a run from a workflow
A workflow can start runs of other workflows, for example one for each item of a list. Start them inside a step:Many runs at once
Each call tonelkap.run is one request to Nelkap, and your plan sets how many requests your workspace can make per second: 50, 500, or 1,000. Above that, run throws a NelkapError with the code throughputLimitReached.
To start thousands of runs, don’t loop over nelkap.run in a request handler. Start one run that lists the items and starts a run per item, each in its own step, as in Fan-out. The steps run one after the other, and a start turned down for throughputLimitReached fails only its own step: catch it, sleep, and try again, as in Retries.
Errors
Every code is described in Errors.