Overview
This node implements a webhook trigger for Toggl Track, allowing users to listen for specific events occurring within a Toggl workspace. When one of the selected events happens (such as creation, update, or deletion of projects, time entries, or tasks), Toggl sends a webhook notification to this node, which then triggers the workflow.
Common scenarios where this node is beneficial include:
- Automating follow-up actions when new projects or tasks are created in Toggl.
- Synchronizing Toggl time entries with other systems in real-time.
- Monitoring updates or deletions in Toggl data to keep external databases or tools consistent.
For example, you could use this node to automatically create a task in a project management tool whenever a new Toggl task is created, or to log time entry changes into a reporting system.
Properties
| Name | Meaning |
|---|---|
| Workspace ID | The numeric ID of the Toggl workspace for which the webhook subscription will be created. |
| Events | The list of Toggl events to listen for. Options include: |
| - Project Created, Project Updated, Project Deleted | |
| - Time Entry Created, Time Entry Updated, Time Entry Deleted | |
| - Task Created, Task Updated, Task Deleted | |
| Description | A textual description for the webhook subscription, useful for identifying it in Toggl's UI. |
Output
The node outputs JSON data representing the payload sent by Toggl when an event occurs. This JSON contains detailed information about the event, such as the type of event and the associated resource data (e.g., project, time entry, or task details).
If the webhook request's signature verification fails, the node responds with an HTTP 401 Unauthorized status and does not output workflow data.
No binary data output is involved.
Dependencies
- Requires an API key credential for authenticating with Toggl Track's API.
- Uses Toggl Track's REST API to create, validate, and delete webhook subscriptions.
- Requires the node to be configured with a valid workspace ID and selected events.
- The node generates and stores a secret used to verify incoming webhook signatures using HMAC SHA256.
Troubleshooting
- Webhook creation failure: If the node cannot create the webhook subscription, it throws an error with the message "Failed to create webhook" followed by the API error message. Ensure the workspace ID is correct and the API key has sufficient permissions.
- Webhook validation warning: After creating the webhook, the node attempts to validate it. If validation fails, a warning is logged but the subscription remains active. This might happen if Toggl's validation endpoint is temporarily unavailable.
- Unauthorized webhook requests: Incoming webhook calls without the required signature header or with an invalid signature are rejected with a 401 Unauthorized response. Make sure Toggl is correctly configured to send webhooks to the node's URL and that the secret matches.
- Webhook deletion failure: On deactivation, if deleting the webhook subscription fails, a warning is logged. This usually does not stop the workflow but may leave orphaned webhooks in Toggl.
