Home
Content Management API⁡𝅶‍‍𝅺⁡‍𝅴⁡𝅴𝅹‍‍⁢𝅵‍‍⁣⁣‌⁡⁣𝅺⁣⁢⁣𝅸⁠⁢‍‍‍𝅷‍‍𝅳⁡‍⁠‍‍⁢𝅵‍‍𝅳⁡⁣⁡⁣⁡​⁡⁢⁢𝅵‍𝅺‍𝅺⁢𝅸⁡⁢‍𝅹⁣‌⁡⁣𝅺⁢𝅸⁡⁢‍𝅹⁢𝅺𝅸‍𝅺⁠⁣𝅴⁡⁣𝅺⁡‍‍𝅺𝅴⁡⁣⁠𝅸⁠𝅺⁡⁣⁡𝅴⁡​⁠⁡⁢‍𝅺⁢𝅳⁢‌⁢​⁢𝅴⁢‍⁢⁠‍𝅺𝅴⁡⁣⁠𝅸⁡⁢‍𝅺⁢⁢⁢𝅴⁢𝅳⁢⁢⁢‌⁢⁡⁢𝅳⁢‌‍‍⁡𝅸
Main resources
Upload-related
Site Search
Environments
UI
Workflows
Async jobs
Roles & permissions
Webhooks
Hosting & CI integrations
Subscription
Enterprise
    Show examples in:
    Update a workflow

    Parameters

    name  string  Optional

    The name of the workflow

    api_key  string  Optional

    Workflow API key

    stages  Array<object>  Optional

    The stages of the workflow

    Returns

    Returns a workflow resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const workflowId = '439239';
    const workflow = await client.workflows.update(workflowId, {
    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();
    Returned output:
    {
    id: '439239',
    name: 'Approval by editors required',
    api_key: 'approval_by_editors',
    stages: [
    {
    id: 'waiting_for_review',
    name: 'Waiting for review',
    initial: true
    }
    ]
    }