Develop
Node SDK
Start a workflow run from your backend with the TypeScript SDK and read the result.
The Node SDK starts a workflow run from server code, such as a webhook handler, a queue worker or a scheduled job.
Install
The builder component and the server client ship in the same package.
npm install flowblocks-jsAuthenticate
The client reads your secret key from the FLOWBLOCKS_SECRET_KEY environment variable.
import { Flowblocks } from "flowblocks-js"
const flowblocks = new Flowblocks()Warning
The secret key can run any workflow in your account. Keep it on the server and out of anything shipped to a browser.
Run a workflow
const run = await flowblocks.runs.create({
workflow: "support-triage",
input: "Where is my refund for order 1042?",
maxSteps: 20,
})
console.log(run.output)Prop
Type
The result
runs.create resolves with the finished run. run.output is what the End step returned. The other fields match the REST API response.