Webhooks, duplicate events

I am not sure but I think this should not be an issue, or at least you should filter on your end. Isn’t it something like that @Phil_Seeman?

Yep - see my response to the same question here:

1 Like

Just to add my two cents here as I’m getting more involved with Asana webhooks. I find the “noisy” approach sending events to be annoying. Asana is essentially sending a bunch of information I didn’t ask for. I wish there was a way to create webhooks that sends only events from a specified parent and nothing else. Seems like a waste of Asana’s and my server resources.

There is – just set a webhook for that specific parent task. Unless you’re saying you don’t want events from its children, which you will also get.

Ok, I think I might have actually set up my webhook incorrectly. I’m attempting to receive events only when a task is added to a specific project but I’m also receiving events for things like a task being assigned to a user in that project.

I’m using the Node client to set up the webhook which looks something like this:

client.webhooks.create(
  projectGid,
  webhookTriggerUrl,
  { 
    "resource": projectGid
    "target": webhookTriggerUrl,
    "filters": {
      "resource_type": task,
      "action": added
    }
  }
)

Did I get something wrong?

Try putting quotation marks around your filter parameters, as in:

"filters": {
  "resource_type": "task",
  "action": "added"
}

Does that help?

In my code I actually have resource_type and action pointing to string variables that say “task” and “added” so I think I should be good there.

I think what’s happening is I not only get events for when tasks are created but when anything is “added” to the task (assignee, due date, tag, etc). Do I need to be more specific with my filters?

@Ross_Grambo what do you think? Seth shouldn’t be getting those events for a “task” “added” filter, right?

1 Like

@Seth_Stevenson, I believe you do see an “added” event anytime the task is added to a project or tag. This can be confusing, as you’re watching a project but it’s children tasks are added to other projects/tags. You’ll still see those events and I believe currently you’ll need to filter those out client side.

For other things like assignee and due_date, you should be receiving a “change” event instead.

Let me know if you’re seeing different functionality then that.

1 Like

I’m getting some unexpected results, but I think I’m going to start a separate thread so I don’t clutter up this one with my specific issue.

1 Like

Hi! I recently set up an integration through Integromat from our Asana to Outlook to send an email to our clients when we’ve completed certain steps in the process. The email is formatted in HTML, and when I started to add variant text in the email like subject, header, and body for each task that is completed it fires off two identical emails. When I click “Explain Scenario” I can see it fires off twice, but I’m not sure why.

I was told by Integromat to reach out to Asana Support and I was directed by Asana Support report to ask here. I’ve done some searching around, and I wasn’t able to find a similar question asked. Does anyone know why it’s firing off twice?

Hi @anon11836725,

I have not-great news. Asana’s API is known to be “noisy”, that is, it fires multiple API events for the same event that occurs in the UI. I’m assuming that’s the source of your duplication.

Normally we developers have to account for this property of the API in the apps that we write. But I’m not sure how you would do that in Integromat.

Is this still the case? As I am watch for new Task in a project and getting 3 sometimes 4 instances of the same task. This is causing an automation to fire multiple times.

Hi @Robert_Tucker,

Yes, unfortunately still the case.

A favor: if you have them handy, could you post the exact duplicate webhook responses you’re getting? Asana devs have asked for more info on these dups; I can pull some from my Flowsana logs but if you have yours handy, that would be awesome.

EDIT: You can send them to me via Private Message if you prefer.

I have a webhook configured to watch for changes to custom fields within a Project.

This webhook is received by Zapier and processed, but I noticed it was erroring every so often.
I was confused by this as I had the same webhook set up in Integromat, but received no such error.

It turns out when events happened in quick succession, Zapier was receiving them almost like a ‘batch’. Integromat has no issue dealing with situations like this, but Zapier does.

Does anyone here know about this batching behaviour? Is there a way I can prevent this?

There’s also a secondary issue but I’ll tackle this one first…

I’m currently trying to set up a Webhook that fires when a task is added to a specific project. This is the current Webhook I have set up.

{
    "data": {
        "gid": "************7713",
        "resource_type": "webhook",
        "resource": {
            "gid": "************6918",
            "resource_type": "project",
            "name": "************[PROGRAM] WEBPROD ************************"
        },
        "target": "************************************.trayapp.io",
        "active": true,
        "created_at": "2021-11-17T22:50:22.649Z",
        "last_failure_at": null,
        "last_failure_content": "",
        "last_success_at": "2021-11-17T22:50:23.720Z",
        "filters": [
            {
                "resource_type": "task",
                "resource_subtype": null,
                "action": "added",
                "fields": null
            }
        ]
    }
}

The issue is, after a task is added to that project, then a rule fires to send that task to another project, the Webhook fires 5 more times.
image

Those additional Webhook triggers are NOT firing on the specified Webhook filters or the project that was specified. Here is an example Event:

{
				"user": null,
				"created_at": "2021-11-17T22:18:54.539Z",
				"action": "added",
				"resource": {
					"gid": "************5584",
					"resource_type": "story",
					"resource_subtype": "added_to_project"
				},
				"parent": {
					"gid": "************0439",
					"resource_type": "task",
					"resource_subtype": "default_task"
				}
			}

The workaround I am currently using that has me unblocked is I duplicated the project that the rule was pushing the task to, changed the rule to push the task to that duplicated project, and now it is only sending one API call.

I believe this is a bug? I am not exactly sure if I am misunderstanding how the system decides to send a Webhook or if this is a bug.

Can anyone shed some light on this situation?
Thank you

Maybe @Phil_Seeman can help. From what I remember he said, there is a lot of noise with webhooks and you might have to discard some of those events.

1 Like

Yes, you can expect to get multiple webhooks for a task change. For example, you can get a “task change” event, then one or more “story” events which log the task change that just occurred.

@Phil_Seeman - seems this is still an issue, correct? I have some webhooks that consistently deliver two payloads every single time they are triggered.

Any known fix for this?

Hi @Bryan_TeamKickstart,

I think they worked on reducing the “noisiness” but it’s still there at least to some extent.