Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Workflow

Update a workflow

Body parameters

name string Optional

The name of the workflow

Example: "Approval by editors required"
api_key string Optional

Workflow API key

Example: "approval_by_editors"
stages Optional

The stages of the workflow

Type: Array<object>
Example: [{ id: "waiting_for_review", name: "Waiting for review", initial: true }]
id string Required

ID of the stage

Example: "waiting_for_review"
name string Required

Name of the stage

Example: "Waiting for review"
description string, null Optional

Description of the stage

Example: "Editor has finished writing and is waiting for approval from a supervisor"
initial boolean Optional

Whether this is the initial stage or not

Returns

Returns a resource object of type workflow

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const workflowId = "uJzC2b6YQg-DW2A5edpQYQ";
const workflow = await client.workflows.update(workflowId, {
id: "uJzC2b6YQg-DW2A5edpQYQ",
});
// Check the 'Returned output' tab for the result ☝️
console.log(workflow);
}
run();
{
id: "uJzC2b6YQg-DW2A5edpQYQ",
name: "Approval by editors required",
stages: [
{ id: "waiting_for_review", name: "Waiting for review", initial: true },
],
api_key: "approval_by_editors",
}