TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node allows users to create a new automated trigger for a workflow. Automated triggers enable workflows to start automatically based on specific events or schedules without manual intervention. This is particularly useful for automating repetitive tasks, integrating with external systems, or responding to database changes or scheduled times.

For example:

  • Creating a trigger that starts a workflow whenever a database event occurs (e.g., a new record is added).
  • Setting up a cron-based trigger to run a workflow at specified intervals (e.g., daily data synchronization).

Properties

Name Meaning
Depth Determines how much related object information to include in the response:
- 0: Only primary object's info.
- 1: Primary object + directly related objects.
- 2: Primary + related objects + their related objects.
Type The type of automated trigger to create. Options are:
- DATABASE EVENT
- CRON
Settings JSON object containing the settings specific to the chosen trigger type. For example, cron schedule details or database event filters.
Workflow Id The identifier of the workflow to which this automated trigger will be attached.

Output

The node outputs a JSON object representing the newly created workflow automated trigger. This includes all relevant details such as its ID, type, settings, and any related nested objects depending on the Depth parameter.

No binary data output is involved.

Dependencies

  • Requires an API key credential to authenticate requests to the external service managing workflow triggers.
  • The base URL for the API is configured via credentials.
  • The node uses HTTP requests with JSON payloads to interact with the API.

Troubleshooting

  • Invalid JSON in Settings: Since the Settings property expects a JSON string parsed into an object, invalid JSON syntax will cause errors. Ensure the JSON is well-formed.
  • Missing Required Fields: The Type and Settings fields are mandatory. Omitting them will result in request failures.
  • Incorrect Workflow Id: Providing an invalid or non-existent workflow ID may cause the API to reject the creation request.
  • API Authentication Errors: Ensure the API key credential is correctly set up and has sufficient permissions.
  • Depth Parameter Misuse: Using a higher depth level may increase response size and latency; use appropriately.

Links and References

  • Cron Expression Tutorial — Useful for configuring cron trigger settings.
  • API documentation for the external service managing workflow triggers (not provided here).

Discussion