The name of the workflow
The stages of the workflow
Workflow API key
import { buildClient } from '@datocms/cma-client-node';async function run() {const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });const workflow = await client.workflows.create({name: 'Approval by editors required',api_key: 'approval_by_editors',stages: [{id: 'waiting_for_review',name: 'Waiting for review',initial: true}]});console.log(workflow);}run();
{id: 'uJzC2b6YQg-DW2A5edpQYQ',name: 'Approval by editors required',api_key: 'approval_by_editors',stages: [{id: 'waiting_for_review',name: 'Waiting for review',initial: true}]}