XoneWork Webhook
XoneWork Webhook is a start component: it starts the flow every time a XoneWork project sends an event by webhook, for example a task was created, changed column, got a comment or got new assignees, a timer was stopped or a sprint was completed. Each event is one run of the flow.
XoneWork signs every delivery with a secret. The component checks that signature and its age, so the flow only starts with deliveries that really come from your XoneWork and were not replayed later.
When to use it
- React instantly when a task is created or changes, without waiting for the next check.
- Start an agent as soon as a task reaches a column, also when someone drags it on the board.
- Answer or act when someone comments on a task.
- Send hours to another application every time a timer stops or time is logged.
- Notify the team when a sprint is activated or completed.
If no token can manage the project’s webhooks and its owner cannot create it either, use XoneWork Trigger, which checks the board without any setup in XoneWork.
Configuration
XoneWork is the one that calls the flow, but you do not have to set anything up there: when you activate the trigger, NappAI creates the webhook in your XoneWork project, keeps its secret and uses it to check the signature of every delivery. When you deactivate it, NappAI deletes the webhook.
You need a XoneWork credential with the XoneWork address and an API token. See Credentials. The token’s person needs the webhooks_can_manage permission in the project, and the token must include it: tick it when you create the token in Account › API tokens.
| Field | What it does |
|---|---|
| Credential | The XoneWork credential. With it NappAI creates, updates and deletes the project’s webhook. |
| Project | The XoneWork project whose events start the flow. Choose it from the list, or write its key, its name or the address of one of its pages. |
| Events | The events that start the flow. Default: task.created, task.updated and task.assigneesChanged. The webhook is created with these same events. |
| Ignore Comments Made Through the API | On by default. Comments written by a flow or an agent through the API do not start the flow, so a flow that comments never triggers itself. Only people’s comments arrive as task.commentCreated. |
| Webhook Secret (advanced) | Only for a webhook created by hand in XoneWork: the secret XoneWork shows once. Leave it empty when the trigger creates the webhook. |
| Max Signature Age (s) (advanced) | 300 by default. Rejects deliveries signed longer ago than these seconds, so nobody can replay an old delivery. 0 turns the check off. |
| Skip Repeated Deliveries (advanced) | On by default. XoneWork may deliver the same event twice when it retries; the component recognises each delivery by its X-Webhook-Delivery header, so each event runs the flow once. |
| Run on Test Deliveries (advanced) | Off by default. XoneWork’s test button sends webhook.test: it is accepted, but does not run the flow unless you turn this on. |
| Data | Used to test the component in the editor. When the flow runs from its webhook, it is filled with what was received. Leave it empty. |
These are the events:
| Event | When it arrives |
|---|---|
task.created | A task is created. |
task.statusChanged | A task changes column, also when someone drags it on the board. It carries the source and target columns. |
task.commentCreated | Someone comments on a task. It carries the comment and its author. |
task.updated | A task changes. It carries the changes in changes. |
task.deleted | A task is deleted. |
task.assigneesChanged | The people assigned to a task change. |
task.assignedToSprint | A task enters a sprint. |
time-entry.started, time-entry.stopped | A timer starts or stops. |
time-entry.created, time-entry.updated, time-entry.deleted | A time entry is created, changed or deleted. |
sprint.created, sprint.updated, sprint.deleted | A sprint is created, changed or deleted. |
sprint.activated, sprint.reviewStarted, sprint.completed, sprint.paused, sprint.resumed | A sprint is activated, goes to review, is completed, paused or resumed. |
Activate it
- Choose the XoneWork credential, the Project and the Events in the component.
- Deploy a version of the flow: deliveries run the deployed version. See Versions and publishing.
- Open the API Access window, go to the New items triggers tab and press Activate on the XoneWork Webhook card. You can also ask the assistant: “leave this flow’s triggers listening”.
When you activate it, NappAI creates the webhook in the project. You will see it in XoneWork, in Webhooks, pointing at an address of your flow that carries no API key. The card changes to Listening and shows when the last event arrived.
- If you change the project or the events, the card changes to Out of sync: press Update and the webhook is updated without changing its secret.
- If you deactivate the trigger, NappAI deletes the webhook from XoneWork.
- If XoneWork turns the webhook off (it does after 10 failed deliveries in a row) or someone deletes it there, the card says so: press Update to turn it on or create it again.
- If the token cannot manage the project’s webhooks, the activation says so. Create a token with
webhooks_can_manageor ask the project’s owner.
Create the webhook by hand
Do this only if no token can manage the project’s webhooks. Leave Project empty and:
- Deploy the flow. Its address looks like this:
<NappAI API address>/api/v1/webhook/<flow id>?x-api-key=<API key>. See API keys. - The project’s owner creates the webhook in XoneWork, in Webhooks, with that address and the same events as in Events.
- XoneWork shows the secret only once. Paste it in Webhook Secret. Without a secret the signature is not checked.
How each delivery is checked
XoneWork signs every delivery with the X-Webhook-Signature-V2 header: sha256= followed by the HMAC-SHA256 of <timestamp>.<body> with the secret, where <timestamp> is the X-Webhook-Timestamp header. NappAI checks that signature and rejects deliveries signed longer ago than Max Signature Age (s), so an old delivery cannot be replayed. When a delivery does not carry that signature, it checks the older one, X-Webhook-Signature, which signs only the body. Every delivery carries its id in X-Webhook-Delivery, which is how repeated deliveries are recognised. When a delivery fails, XoneWork retries twice (after 10 and 20 seconds), and it turns the webhook off after 10 failures in a row.
Output
The Data output delivers the event with these fields:
eventandtimestamp: the event and when it happened.delivery_id: the delivery’s id.task: the full task, when the event is about a task. Shortcuts:task_id,title,task_number(alsonumber),parent_id(on a subtask, the task it belongs to),project_id,column_id,priority(low,mediumorhigh) andcompleted.changes: what changed, intask.updated.from_columnandto_column: the names of the source and target columns, intask.statusChanged, with their ids infrom_column_idandto_column_id.commentandcomment_author: the comment’s text and who wrote it, intask.commentCreated, with its id incomment_id.initiator_kindsays whether a person wrote it (user) or it came through the API.assignee_ids: the assigned people.initiator_id: who made the change.sprintandsprint_id: the sprint, in sprint events.entry: the time entry, in time events.
The fields come with XoneWork’s ids. To read the task with its key, its column by name and its people by email, connect XoneWork Tasks with Get Task and the task_id field in Task.
If an event not ticked in Events, a test, a repeated delivery or a comment made through the API with Ignore Comments Made Through the API on arrives, the flow stops at this component without an error. If the signature is not valid or is too old, the delivery is rejected.
Example
A company wants to send every time entry logged in XoneWork to its billing tool.
- Add XoneWork Webhook, choose the XoneWork credential and the Project, and tick
time-entry.stoppedandtime-entry.createdin Events. - Connect Data to an agent or a component that reads the
entryfield and sends it to the billing application. - Deploy the flow and activate the trigger in API Access: the webhook is created in XoneWork for you.
For an agent that answers the comments on tasks, tick task.commentCreated in Events, keep Ignore Comments Made Through the API on and pass comment and task_id to the agent: the comments the agent itself writes with XoneWork Comments do not start the flow again.
Good practices
- Let the trigger create the webhook: the address carries no API key and every delivery is checked by its signature.
- Tick only the events you will use.
- After changing the project or the events, deploy and press Update on the trigger’s card.
- Keep Skip Repeated Deliveries on: XoneWork’s retries may deliver the same event twice.
- Keep Ignore Comments Made Through the API on if the flow comments on tasks: that way it does not start with its own comments.
- A flow can have only one webhook component.
Security and limitations
- Creating the webhook needs the
webhooks_can_managepermission in the project, for the person and in the token. - XoneWork turns the webhook off after 10 failures in a row. The trigger’s card warns about it and Update turns it on again.
- The secret of the webhook the trigger creates is stored encrypted and is never shown.
- If you delete the flow without deactivating the trigger first, the webhook stays in XoneWork: its deliveries are rejected and XoneWork turns it off by itself. You can delete it there.
- There is one webhook per flow: the trigger uses the first XoneWork Webhook of the flow.
Related components
- XoneWork Trigger: starts the flow by checking the board, with no setup in XoneWork.
- XoneWork Tasks: read, create, move and assign tasks.
- XoneWork Comments: read and write comments.
- XoneWork Projects: projects, columns, members, tags and sprints; it also lists and deletes the project’s webhooks.
- XoneWork Time Tracking: time spent on tasks.
- XoneWork Attachments: the files attached to a task.
- Webhook Input: the generic webhook, for any other application.