Adobe Campaign JavaScript SDK

Workflow API

Start and stop wotkflows, passing either an id or workflow internal name

await NLWS.xtkWorkflow.stop(4900);
await NLWS.xtkWorkflow.start(4900);

A workflow can be started with parameters. Variables, are passed as attributes of the parameters document.

await NLWS.xtkWorkflow.startWithParameters(4900, { hello: "world" });

The variables can be used in the workflow as attributes of the instance.vars variable.

logInfo(instance.vars.hello);

Note that workflows are executed asynchronously by Campaign. When the promise returned by the start function resolves, the workflow is not finished. The promise resolution indicates that the request to start (or stop) the workflow has been accepted by the server.