Start a workflow from Asana events
To run a workflow when Asana reports an added, changed, or deleted task, project, or story, add a Webhook block whose Source is Asana and create an Asana webhook that sends to its URL. Asana posts events as a list in one request. Each event in the list starts its own run.
Asana creates webhooks only through its API, so you need a way to send it one API request and a credential it accepts, such as a personal access token. You also need edit access to the workflow’s project.
Add the Webhook block and generate its URL
Section titled “Add the Webhook block and generate its URL”- In a draft workflow, add a Webhook block. The block palette also lists Asana webhook in the Start group, which adds the block with its source already set.
- Under Source, choose Asana. The line under the setting reads “Verifies the signature · one run per event in a batch · skips duplicates”.
- Under Webhook URL, select Generate URL, then copy the URL.
The badge beside the URL reads “Runs start after publish”. The URL contains a token, and anyone who has the URL can send requests to it. Keep it out of shared documents.
Select Connect, then create the webhook in Asana
Section titled “Select Connect, then create the webhook in Asana”Asana makes the secret it signs with. It sends that secret to the block’s URL once, in its first request, while the webhook is being created. The block saves a secret that arrives this way only while it is waiting for one, so start the wait before you create the webhook.
- In the block’s settings, under Hook secret, select Connect. The line then starts “Waiting for Asana until”, followed by a time 15 minutes ahead, and ends “Create the webhook in Asana now.”
- Before that time, send Asana’s API the request that creates a webhook. Give the id of the task or project to watch as
resourceand the block’s URL astarget. - Wait for Asana’s reply to that request.
While your request is open, Asana posts the secret to the URL. The block saves it and answers, and Asana then replies that the webhook is created. The settings show only the last four characters of the secret, with Replace and Remove. Under Set up, the second line changes to “The hook secret is saved: deliveries are verified.” Recent deliveries lists the request as Handshake with “Asana connected: its secret is saved, and deliveries are verified from now on.”
The first secret that arrives ends the wait. Stop waiting ends it sooner. A secret that arrives when the block is not waiting is not saved, and Asana’s request to create the webhook fails. Recent deliveries then lists a Handshake with “Asana sent a secret, but this trigger was not waiting for one, so it was not saved. Press Connect in the block’s settings, then create the webhook in Asana again.”
Asana also returns the secret in its reply to the request that created the webhook, as X-Hook-Secret. If you kept that value, you can paste it into the field that shows “Or paste the hook secret” and select Save in place of Connect.
Asana issues the secret for one webhook, so OutWin saves it on the block’s URL. It is not saved on a connection. A second Webhook block has its own URL and needs its own Asana webhook.
The Webhook block offers these Asana event types: task.added, task.changed, task.removed, task.deleted, task.undeleted, project.added, project.changed, section.added, section.changed, story.added, attachment.added, and tag.added.
Without a saved secret the block still starts runs, and nothing is verified: anyone who has the URL can start the workflow. Publishing then shows a warning that ends “has no signing secret saved, so its deliveries are not verified: anyone who has this URL can start this workflow”. The warning does not block publishing.
Choose which events start a run
Section titled “Choose which events start a run”Under Events that start a run, tick the event types that start a run. With none ticked, every event Asana sends starts a run.
Asana has no single field for an event’s type. OutWin joins the kind of thing that changed and what happened to it with a dot, as in task.changed. To start runs for a type that is not listed, type it in that form into the box under the list and select Add.
An event whose type is not ticked is listed as Filtered out and starts no run. To narrow further by a field of the event, add a row under Only when. For example, a row with the field body.change.field starts runs for changes to one field of a task only. Webhook settings lists the comparisons.
Send a test and check what arrived
Section titled “Send a test and check what arrived”- In Asana, change something the webhook watches, such as the name of a task in the project.
- In OutWin, look under Recent deliveries in the block’s settings.
Recent deliveries lists every event that reached the URL, including while the workflow is a draft. Events that arrived in one request are listed one by one, each marked with its place in the request, such as “2 of 5”. On a draft each is listed as Dropped with “The workflow is not published, so nothing ran.” It starts no run and is not run later. The last line under Set up changes to, for example, “Received task.changed. Dropped.”
Asana also posts an empty list when the webhook is created and every eight hours after that, to check that the URL still answers. The block answers it. An empty list starts no run and is not listed under Recent deliveries.
With a secret saved, an event listed as Dropped on a draft has passed the signature check. A delivery that fails the check is listed as Refused.
If you have edit access, select an event to see what the block passed on. The list is kept for seven days, and the data of the newest 20 events is kept.
Read the event in the next block
Section titled “Read the event in the next block”Each run receives one Asana event. An HTTP request block or a database block directly after the Webhook block reads it with these expressions. An AI block such as Think receives the whole value as its input.
| Expression | What it holds |
|---|---|
{{input.body}} |
The event as Asana sent it, with fields such as user, resource, action, parent, created_at, and change. |
{{input.body.resource.gid}} |
One field of the event: the id of the task, project, or other thing the event is about. Read any other field the same way. |
{{input.event.type}} |
The event’s type, such as task.changed. OutWin joins the event’s resource.resource_type and action fields with a dot. |
{{input.event.id}} |
An id OutWin builds from the event’s resource.gid, action, created_at, change.field, and parent.gid fields, because Asana sends no event id. |
{{input.event.time}} |
The event’s time as an ISO 8601 date and time. It is the event’s created_at field. |
{{input.delivery.verified}} |
true only when the signature was checked and passed. |
An event names the thing that changed and holds few of its details. If the workflow needs the task’s name, assignee, or other fields, read the task from Asana’s API with an HTTP request block and {{input.body.resource.gid}}.
A block further along reads the same values through the Webhook block’s name, as in {{steps["Asana"].body.resource.gid}} for a block named Asana. Data and context describes what each block passes on.
Publish and check the runs
Section titled “Publish and check the runs”Publish the workflow. From then on, each event that passes the filter starts a run. On a published workflow the block’s settings are read-only, and Recent deliveries is in the block’s inspector. The secret is there too. To replace it, select Replace, then Connect, and create a new webhook in Asana, because each Asana webhook has its own secret. Delete the old webhook in Asana afterwards.
| Outcome | What happened |
|---|---|
| Ran | The event started a run. |
| Waiting | 10 runs of the workflow are already active. The event starts a run when one of them ends. An event that waits longer than an hour is listed as Dropped. |
| Duplicate | An event with the same id already ran in the last 72 hours. The line reads “This event was already received and run, so it did not run again.” |
| Handshake | Asana’s first request, which carried its secret. It starts no run. |
Runs start in the order events arrive. That is not always the order things happened, so do not build a workflow that relies on task.added arriving before task.changed.
Receiving an event costs no credits, and neither does an event that is filtered out, a duplicate, or a handshake. A run that starts uses credits for the blocks that run in it.
If nothing runs
Section titled “If nothing runs”Open Recent deliveries and read the outcome and the sentence beside the newest event.
| What you see | Cause | Fix |
|---|---|---|
| “Nothing has arrived yet.” | No request has reached the URL, not even Asana’s first one. | Check that the target in your request to Asana is the block’s current URL. Rotate token on a published workflow changes the URL, and the old one stops working. |
| Handshake with “Asana sent a secret, but this trigger was not waiting for one, so it was not saved.” | The webhook was created in Asana before Connect was selected, or after the 15 minutes ended. Asana’s request to create it failed. | Select Connect, then send the request to Asana again. |
| Handshake with “Asana connected” and nothing else | The webhook exists, and nothing it watches has changed since. | Change a task or project that the webhook’s resource covers. |
| Dropped with “The workflow is not published, so nothing ran.” | The workflow is a draft. | Publish the workflow. Events that arrived before then are not run later. |
| Dropped with “The workflow is paused, so nothing ran.” | The workflow is paused. | Resume the workflow. Events that arrived while it was paused are not run later. |
Filtered out with Events of type "story.added" are not chosen on this trigger. |
The event’s type is not ticked under Events that start a run. | Tick the type, or clear every tick so that all events start a run. The settings are read-only on a published workflow. |
| Refused with “The signature did not match. Check that the secret saved here is the one the sender shows for this URL.” | The saved secret is not the one Asana made for the webhook that sent the request. This can happen when a pasted secret came from another webhook, or when an earlier webhook in Asana still sends to the URL after the secret was replaced. | Delete the webhooks in Asana that send to this URL. Then select Replace and Connect, and create one webhook again. You do not republish the workflow. |
| Refused with “The request carried no signature.” | A secret is saved in OutWin, and the request did not carry Asana’s signature. A request sent by hand to try the URL has none. | Change something in Asana so that Asana sends the request. |
A delivery listed as Refused is answered with status 401 and starts nothing. OutWin keeps none of its data. Asana sends a failed delivery again, and deletes a webhook that it could not deliver to for 24 hours. For every other outcome in the table, Asana receives a success response and OutWin does not run the event later.