TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node allows updating a single workflow run in an external system via its API. It is useful when you want to modify details of an existing workflow execution, such as changing its status, updating output data, or adjusting metadata like start and end times.

Common scenarios include:

  • Marking a workflow run as completed or failed after processing.
  • Updating the output data of a workflow run with new results.
  • Changing the workflow version or position associated with a run.
  • Adding contextual information or changing the executor details.

For example, after a workflow finishes running, you might use this node to update the run's status to "COMPLETED" and attach the final output data for record-keeping or further analysis.

Properties

Name Meaning
Id The unique identifier of the workflow run to update. This is required.
Depth Determines how much related nested data to include in the response: 0 (only primary object), 1 (primary + directly related objects), or 2 (primary + related + their related objects).
Workflow Version Id The ID of the workflow version to associate with this run.
Workflow Id The ID of the workflow to associate with this run.
Position Numeric position of the workflow run, possibly indicating order or sequence.
Output JSON object representing the output data of the workflow run.
Created By JSON object describing the executor or creator of the workflow run.
Status Current status of the workflow run. Options are: NOT STARTED, RUNNING, COMPLETED, FAILED.
Ended At Timestamp string indicating when the workflow run ended.
Name Name assigned to the workflow run.
Started At Timestamp string indicating when the workflow run started.
Context JSON object containing additional context information related to the workflow run.

Output

The node outputs the updated workflow run object in JSON format. The structure includes all fields sent in the update plus any additional related data depending on the Depth parameter. This typically contains identifiers, status, timestamps, output data, and contextual information.

If the workflow run includes binary data, it would be represented accordingly, but this node primarily deals with JSON data updates.

Dependencies

  • Requires an API key or authentication token credential to connect to the external service managing workflow runs.
  • The base URL for the API is configured via credentials.
  • The node uses standard HTTP headers for JSON content type and accepts JSON responses.

Troubleshooting

  • Missing or invalid Id: The node requires a valid workflow run ID to update. Ensure the ID is correct and exists in the target system.
  • Invalid JSON in properties like Output, Created By, or Context: These fields expect valid JSON strings. Malformed JSON will cause errors. Use proper JSON formatting.
  • Unauthorized or authentication errors: Verify that the API key or authentication token is correctly set up and has permissions to update workflow runs.
  • Invalid status value: The status must be one of the predefined options (NOT_STARTED, RUNNING, COMPLETED, FAILED). Using unsupported values will cause errors.
  • API connectivity issues: Check network connectivity and API endpoint configuration if requests fail.

Links and References

  • Refer to the external API documentation for workflow runs to understand field meanings and constraints.
  • JSON formatting guides can help ensure correct input for JSON-type properties.
  • n8n documentation on using credentials and HTTP request nodes may assist in setting up authentication.

Discussion