TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node allows updating a single workflow in the connected system via its API. It is useful when you want to modify existing workflows by changing their properties such as name, position, statuses, or metadata like the creator information. Typical use cases include automating workflow management, synchronizing workflow changes from external systems, or programmatically adjusting workflow configurations based on dynamic conditions.

For example, you might update a workflow’s name and position after a reorganization of your automation processes, or update the last published version ID to reflect a new deployment.

Properties

Name Meaning
Id The unique identifier of the workflow object to update. This is required to specify which workflow will be modified.
Depth Determines how much nested related data to include in the response:
- 0: Only the primary workflow data.
- 1: Primary workflow plus directly related objects.
- 2: Includes related objects of related objects.
Last Published Version Id The identifier of the workflow's last published version. Useful for tracking or updating the published state.
Name The new or updated name of the workflow.
Created By JSON object describing the creator of the workflow record. This can include user details or metadata about who created the workflow.
Position Numeric value indicating the workflow's position or order among other workflows.
Statuses JSON array representing the current statuses of the workflow versions. This can be used to update or set the status states for different versions of the workflow.

Output

The node outputs the updated workflow object in JSON format. The structure includes the updated fields and may also contain nested related objects depending on the Depth property setting. The output reflects the state of the workflow after the update operation.

If the API supports binary data for workflows (e.g., attachments or exported files), it would be included in the binary output; however, based on the provided code and properties, this node primarily deals with JSON data.

Dependencies

  • Requires an API key credential to authenticate requests to the Twenty API.
  • The base URL for API requests is configured dynamically from credentials.
  • The node depends on the @devlikeapro/n8n-openapi-node package and a bundled OpenAPI specification file (twenty-v1.0.3-openapi.json) to build request properties and handle communication with the API.

Troubleshooting

  • Missing or invalid Id: Since the Id property is required, omitting it or providing an incorrect ID will cause the update to fail. Ensure the workflow ID exists and is correctly specified.
  • Invalid JSON in Created By or Statuses: These properties expect valid JSON strings. Malformed JSON will cause parsing errors. Validate JSON syntax before input.
  • Permission errors: If the API key lacks permissions to update workflows, the node will return authorization errors. Verify that the API key has sufficient rights.
  • Network or API errors: Connectivity issues or API downtime will result in request failures. Check network connectivity and API status.
  • Depth parameter misuse: Setting an unsupported depth level may lead to unexpected responses or errors. Use only 0, 1, or 2 as defined.

Links and References

Discussion