> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

# Update a workflow definition

PUT https://api.contentful.com/spaces/{space_id}/environments/{environment_id}/workflow_definitions/{workflow_definition_id}
Content-Type: application/vnd.contentful.management.v1+json

Updates a workflow definition by ID. Only org or space admins can update workflow definitions.

Reference: https://contentful.com/developers/docs/references/content-management-api/workflow-definitions/update-a-workflow-definition

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `space_id` (string, required) — ID of the space in form of a string
- `environment_id` (string, required) — ID of the environment in form of a string
- `workflow_definition_id` (string, required) — ID of the workflow definition in form of a string

### Headers

- `X-Contentful-Version` (string, required) — Version of the workflow definition to update

### Body (application/vnd.contentful.management.v1+json)

This endpoint expects a map from string to any.

- `map from string to any`

## Response

### 200

OK - Request successful

- `map from string to any`

## Examples

### Update a standard workflow definition

**Request**

```json
{
  "appliesTo": [
    {
      "linkType": "Entry",
      "type": "Link",
      "validations": [
        {
          "linkContentType": [
            "content_type_a",
            "content_type_b",
            "content_type_c"
          ]
        }
      ]
    }
  ],
  "description": "description",
  "flowType": "strict_neighbor",
  "name": "name",
  "startOnEntityCreation": true,
  "steps": [
    {
      "actions": [
        {
          "configuration": {
            "recipients": [
              "custom@example.com",
              {
                "sys": {
                  "id": "someTeamId",
                  "linkType": "Team",
                  "type": "Link"
                }
              }
            ]
          },
          "type": "email"
        },
        {
          "configuration": {
            "assignee": {
              "sys": {
                "id": "someTeamId",
                "linkType": "Team",
                "type": "Link"
              }
            },
            "body": "Please take care of this until Friday.",
            "dueDate": "3"
          },
          "type": "task"
        },
        {
          "appActionId": "theSlackAppActionId",
          "appId": "theSlackAppId",
          "configuration": {
            "body": {
              "channelId": "someSlackChannelId",
              "message": "myCustomSlackMessage",
              "workspaceId": "someConnectedSlackWorkspaceId"
            }
          },
          "type": "app"
        }
      ],
      "annotations": [
        "cf-color-1",
        "some-custom-annotation"
      ],
      "description": "Move to the next step when starting work",
      "id": "someStepId",
      "name": "To Do",
      "permissions": [
        {
          "configuration": {
            "action": "publish",
            "actors": "all",
            "effect": "deny"
          },
          "type": "entity_permission"
        },
        {
          "configuration": {
            "action": "edit",
            "actors": [
              {
                "sys": {
                  "id": "someUserId",
                  "linkType": "User",
                  "type": "Link"
                }
              }
            ],
            "effect": "allow"
          },
          "type": "workflow_permission"
        }
      ]
    },
    {
      "actions": [
        {
          "configuration": {
            "recipients": [
              "custom@example.com",
              {
                "sys": {
                  "id": "someTeamId",
                  "linkType": "Team",
                  "type": "Link"
                }
              }
            ]
          },
          "type": "email"
        },
        {
          "configuration": {
            "assignee": {
              "sys": {
                "id": "someTeamId",
                "linkType": "Team",
                "type": "Link"
              }
            },
            "body": "Please take care of this until Friday.",
            "dueDate": "3"
          },
          "type": "task"
        },
        {
          "appActionId": "theSlackAppActionId",
          "appId": "theSlackAppId",
          "configuration": {
            "body": {
              "channelId": "someSlackChannelId",
              "message": "myCustomSlackMessage",
              "workspaceId": "someConnectedSlackWorkspaceId"
            }
          },
          "type": "app"
        }
      ],
      "annotations": [
        "cf-color-1",
        "some-custom-annotation"
      ],
      "description": "Move to the next step when starting work",
      "name": "To Do",
      "permissions": [
        {
          "configuration": {
            "action": "publish",
            "actors": "all",
            "effect": "deny"
          },
          "type": "entity_permission"
        },
        {
          "configuration": {
            "action": "edit",
            "actors": [
              {
                "sys": {
                  "id": "someUserId",
                  "linkType": "User",
                  "type": "Link"
                }
              }
            ],
            "effect": "allow"
          },
          "type": "workflow_permission"
        }
      ]
    }
  ]
}
```

**Response**

```json
{
  "appliesTo": [
    {
      "linkType": "Entry",
      "type": "Link",
      "validations": [
        {
          "linkContentType": [
            "content_type_a",
            "content_type_b",
            "content_type_c"
          ]
        }
      ]
    }
  ],
  "description": "description",
  "flowType": "strict_neighbor",
  "name": "name",
  "startOnEntityCreation": true,
  "steps": [
    {
      "actions": [
        {
          "configuration": {
            "recipients": [
              "custom@example.com",
              {
                "sys": {
                  "id": "someTeamId",
                  "linkType": "Team",
                  "type": "Link"
                }
              }
            ]
          },
          "type": "email"
        },
        {
          "configuration": {
            "assignee": {
              "sys": {
                "id": "someTeamId",
                "linkType": "Team",
                "type": "Link"
              }
            },
            "body": "Please take care of this until Friday.",
            "dueDate": "3"
          },
          "type": "task"
        },
        {
          "appActionId": "theSlackAppActionId",
          "appId": "theSlackAppId",
          "configuration": {
            "body": {
              "channelId": "someSlackChannelId",
              "message": "myCustomSlackMessage",
              "workspaceId": "someConnectedSlackWorkspaceId"
            }
          },
          "type": "app"
        }
      ],
      "annotations": [
        "cf-color-1",
        "some-custom-annotation"
      ],
      "description": "Move to the next step when starting work",
      "id": "someStepId",
      "name": "To Do",
      "permissions": [
        {
          "configuration": {
            "action": "publish",
            "actors": "all",
            "effect": "deny"
          },
          "type": "entity_permission"
        },
        {
          "configuration": {
            "action": "edit",
            "actors": [
              {
                "sys": {
                  "id": "someUserId",
                  "linkType": "User",
                  "type": "Link"
                }
              }
            ],
            "effect": "allow"
          },
          "type": "workflow_permission"
        }
      ]
    },
    {
      "actions": [
        {
          "configuration": {
            "recipients": [
              "custom@example.com",
              {
                "sys": {
                  "id": "someTeamId",
                  "linkType": "Team",
                  "type": "Link"
                }
              }
            ]
          },
          "type": "email"
        },
        {
          "configuration": {
            "assignee": {
              "sys": {
                "id": "someTeamId",
                "linkType": "Team",
                "type": "Link"
              }
            },
            "body": "Please take care of this until Friday.",
            "dueDate": "3"
          },
          "type": "task"
        },
        {
          "appActionId": "theSlackAppActionId",
          "appId": "theSlackAppId",
          "configuration": {
            "body": {
              "channelId": "someSlackChannelId",
              "message": "myCustomSlackMessage",
              "workspaceId": "someConnectedSlackWorkspaceId"
            }
          },
          "type": "app"
        }
      ],
      "annotations": [
        "cf-color-1",
        "some-custom-annotation"
      ],
      "description": "Move to the next step when starting work",
      "name": "To Do",
      "permissions": [
        {
          "configuration": {
            "action": "publish",
            "actors": "all",
            "effect": "deny"
          },
          "type": "entity_permission"
        },
        {
          "configuration": {
            "action": "edit",
            "actors": [
              {
                "sys": {
                  "id": "someUserId",
                  "linkType": "User",
                  "type": "Link"
                }
              }
            ],
            "effect": "allow"
          },
          "type": "workflow_permission"
        }
      ]
    }
  ],
  "sys": {
    "createdAt": "2025-10-02T17:02:51.000Z",
    "createdBy": {
      "sys": {
        "id": "someUserId",
        "linkType": "User",
        "type": "Link"
      }
    },
    "environment": {
      "sys": {
        "id": "staging",
        "linkType": "Environment",
        "type": "Link"
      }
    },
    "id": "someWorkflowDefinitionId",
    "isLocked": false,
    "space": {
      "sys": {
        "id": "yadj1kx9rmg0",
        "linkType": "Space",
        "type": "Link"
      }
    },
    "type": "WorkflowDefinition",
    "updatedAt": "2025-10-02T17:02:51.000Z",
    "updatedBy": {
      "sys": {
        "id": "1xGZIRXr2WPnsLkKfREo0z",
        "linkType": "User",
        "type": "Link"
      }
    },
    "version": 1
  }
}
```

**SDK Code**

```android Android
SDK currently doesn't implement this endpoint.
```

```java Java
SDK currently doesn't implement this endpoint.
```

```kotlin Kotlin
SDK currently doesn't implement this endpoint.
```

```swift Swift
We currently don't provide a CMA SDK for this platform.
```

```js-legacy JavaScript (legacy)
SDK currently doesn't implement this endpoint.
```

```javascript JavaScript
import { createClient } from 'contentful-management'

// Client init
const client = contentful.createClient({
  accessToken: '<content_management_api_key>'
})

const updatedWorkflowDefinition = await client.workflowDefinition.update({
  spaceId: '<space_id>',
  environmentId: '<environment_id>',
  workflowDefinitionId: '<workflow_definition_id>',
}, {
  ...workflowDefinition,
  steps: [
    ...workflowDefinition.steps,
    newStep,
  ]
})
```

```php PHP
SDK currently doesn't implement this endpoint.
```

```ruby Ruby
SDK currently doesn't implement this endpoint.
```

```python Python
SDK currently doesn't implement this endpoint.
```

```.net .NET
SDK currently doesn't implement this endpoint.
```

### Update a localized workflow definition

**Request**

```json
{
  "appliesTo": [
    {
      "linkType": "Entry",
      "type": "Link",
      "validations": [
        {
          "linkContentType": [
            "blogPost",
            "article"
          ]
        }
      ],
      "variableValuePresets": [
        {
          "id": "spanish-preset-id",
          "name": "Spanish Translation",
          "variableValues": [
            {
              "variable": {
                "sys": {
                  "id": "translator-variable-id",
                  "linkType": "WorkflowVariable",
                  "type": "Link"
                }
              }
            },
            {
              "value": {
                "sys": {
                  "id": "spanish-translator-user-id",
                  "linkType": "User",
                  "type": "Link"
                }
              }
            }
          ]
        }
      ],
      "variables": [
        {
          "id": "translator-variable-id",
          "name": "Translator",
          "type": "subject"
        }
      ]
    }
  ],
  "name": "Updated Translation Workflow"
}
```

**Response**

```json
{
  "appliesTo": [
    {
      "linkType": "Entry",
      "type": "Link",
      "validations": [
        {
          "linkContentType": [
            "blogPost",
            "article"
          ]
        }
      ],
      "variableValuePresets": [
        {
          "id": "spanish-preset-id",
          "name": "Spanish Translation",
          "variableValues": [
            {
              "variable": {
                "sys": {
                  "id": "translator-variable-id",
                  "linkType": "WorkflowVariable",
                  "type": "Link"
                }
              }
            },
            {
              "value": {
                "sys": {
                  "id": "spanish-translator-user-id",
                  "linkType": "User",
                  "type": "Link"
                }
              }
            }
          ]
        }
      ],
      "variables": [
        {
          "id": "translator-variable-id",
          "name": "Translator",
          "type": "subject"
        }
      ]
    }
  ],
  "name": "Updated Translation Workflow",
  "sys": {
    "createdAt": "2025-11-12T15:25:24.000Z",
    "createdBy": {
      "sys": {
        "id": "someUserId",
        "linkType": "User",
        "type": "Link"
      }
    },
    "environment": {
      "sys": {
        "id": "staging",
        "linkType": "Environment",
        "type": "Link"
      }
    },
    "id": "someWorkflowDefinitionId",
    "isLocked": false,
    "space": {
      "sys": {
        "id": "yadj1kx9rmg0",
        "linkType": "Space",
        "type": "Link"
      }
    },
    "type": "WorkflowDefinition",
    "updatedAt": "2025-11-12T15:25:24.000Z",
    "updatedBy": {
      "sys": {
        "id": "1xGZIRXr2WPnsLkKfREo0z",
        "linkType": "User",
        "type": "Link"
      }
    },
    "version": 1
  }
}
```

**SDK Code**

```android Android
SDK currently doesn't implement this endpoint.
```

```java Java
SDK currently doesn't implement this endpoint.
```

```kotlin Kotlin
SDK currently doesn't implement this endpoint.
```

```swift Swift
We currently don't provide a CMA SDK for this platform.
```

```js-legacy JavaScript (legacy)
SDK currently doesn't implement this endpoint.
```

```javascript JavaScript
import { createClient } from 'contentful-management'

// Client init
const client = contentful.createClient({
  accessToken: '<content_management_api_key>'
})

const updatedWorkflowDefinition = await client.workflowDefinition.update({
  spaceId: '<space_id>',
  environmentId: '<environment_id>',
  workflowDefinitionId: '<workflow_definition_id>',
}, {
  ...workflowDefinition,
  steps: [
    ...workflowDefinition.steps,
    newStep,
  ]
})
```

```php PHP
SDK currently doesn't implement this endpoint.
```

```ruby Ruby
SDK currently doesn't implement this endpoint.
```

```python Python
SDK currently doesn't implement this endpoint.
```

```.net .NET
SDK currently doesn't implement this endpoint.
```