N8n workflow idea: notify your team when an AI agent finishes a Jira ticket

I’m working on how to add AI agents to Jira-like workflows, and n8n turned out to be the perfect glue around it.

Setup:

  • Jira tickets are synced with an agent tool (I use Sharkly.ai, disclosure: I work on it). The agent does the coding task and writes its result back as a Jira comment, since the sync is bidirectional.
  • n8n handles everything around that:
    1. Jira Trigger on comment created / issue updated.
    2. IF node: is the comment from the agent account?
    3. Slack / Email node: notify the reviewer with the ticket link.
    4. Optional: log the result to Google Sheets for weekly reporting.

This way the team never has to watch the board, and the review step stays human.

How do you route Jira events in n8n? Do you filter by label or by assignee?

It is probably best to route on the label rather than the assignee. This is because assignees can change a lot and labels survive reassignments. Put an IF or Switch node right after the trigger for the check.

One gotcha to watch for is loops: if the agent’s comment fires an “issue updated” event as well, it can end up reacting to its own comments. Match on the author’s accountId and not display name, since names can change or collide.

Are you listening to both events or just the comment that was created? That will determine if the issue updated adds noise.

1 Like

Nice setup — this is the classic agent-orchestration pattern, and you’re right to keep the review step human.

On your routing question: labels over assignees, every time. Assignees churn; labels survive reassignment. But I’d go one level deeper than label-vs-assignee, because which event you trigger on matters more than how you filter it.

The loop problem Anthony raised is the real trap, and the cleanest fix is to trigger on the smallest event that means “agent is done.” If your agent tool can transition the issue (say, to In Review) when it finishes, trigger on the status change instead of the comment. That’s one unambiguous signal per ticket — no noise, no duplicates. If you have to key off comments, listen to comment created only, never issue updated. Issue-updated fires for everything: the agent’s comment, your own notification comment, a label edit. That path is exactly how you end up reacting to your own comments.

Whichever event you use, harden the front of the workflow. First node checks that the comment author’s accountId matches the agent’s account — accountId, never display name, since names change and collide. Then check a processed ledger of comment IDs before doing anything else. The Jira Trigger polls, so a missed poll window can redeliver the same event; deduping on comment ID keeps retries from double-notifying Slack.

Two structural things I’d change. Split intake from notify: one workflow listens, validates, and logs; a second (via Execute Sub-workflow) formats and sends to Slack or email. That keeps rate limits, retries, and message formatting independent of intake, and it restarts cleanly. And write every agent completion to a small log — issue key, comment ID, timestamp. That’s your weekly reporting for free, and the audit trail you’ll want when someone asks “which tickets did the agent touch.”

I build these loops regularly — labels plus accountId matching on comment-created only has been the reliable combo for me.

1 Like

Good catch on the loop, I hadn’t thought about that. I’m listening to both events right now, so yeah, issue updated is probably firing every time the agent comments. Going to switch to comment created only.

Also didn’t know display names could collide like that, I’ll switch the check to accountId.

Label routing makes sense too, I’ll try an ai-agent label with a Switch node. Is filtering on accountId enough to stop the loop in your experience, or do you add another check on top?

This is super helpful, thanks for taking the time.

The status change idea is cleaner than what I had. Our agent can already move tickets through the workflow, and the status syncs back to Jira, so triggering on the move to In Review should work. That gives one signal per ticket instead of parsing comments.

Hadn’t thought about the Jira Trigger redelivering events either. The comment ID dedup makes sense, and splitting intake from notify too. Right now everything is in one workflow and it’s already getting messy.

Quick question on the ledger: what do you usually store it in? n8n data tables, a Google Sheet, or something like Redis/Postgres?

Filtering on accountId stops only what that account authors, and the loop usually comes back through your own write-backs: when n8n adds the ai-agent label or posts its summary comment, Jira emits another event, which is why issue-updated feels like it fires forever. So layer it: trigger on comment-created only, filter on the agent’s accountId, then add an idempotency guard keyed on the Jira comment id kept in a Data Table or Postgres, skipping anything already processed, since webhooks get redelivered and a retried execution will otherwise handle the same comment twice. If your Switch node writes a label after routing, treat that write as an event too, and either exclude label changes from what you listen for or record them in the same guard. In practice the guard is what breaks the loop; the accountId filter only narrows the blast radius.

using n8n as the notification and dispatch wrapper around background ai agent jobs is such a clean pattern. polling jira directly from agent runtimes usually causes duplicate notifications if a worker retries midway through.

for our team pipelines, routing event-driven notifications and social release queues through blotato gave us reliable webhook callbacks without having to maintain brittle polling scripts. it keeps status handoffs instantaneous while n8n manages data transformations.

are you triggering the jira webhook on status change or having the agent ping an n8n webhook directly upon completion?

For a small team’s loop I’d keep it in an n8n Data Table — zero extra infra, the dedupe is a single lookup, and it lives where the workflow runs. Postgres earns its place when the fleet grows: indexed lookup plus a UNIQUE constraint on comment_id doubles as a backstop, so even racing retries can’t double-insert. I’d skip Sheets for this one — fine as a readable log, but as a ledger it’s the slowest option and the weakest under redelivery.

For the loop, using accountId on its own will usually be enough, as long as the agent posts from a dedicated account. The catch is if it ever comments through a human’s API token or a shared account, since then the check cannot tell them apart. In that case, add a marker the agent includes in its comments (a fixed prefix, say) and check for that too.

Comment created only should also cut most of the noise out. It seems like your ai-agent label plus a Switch is a good setup.

When routing Jira event webhooks in n8n for automated agent notifications, filtering directly by assignee or label at the trigger level prevents unnecessary webhook executions. However, the most reliable architecture relies on a strict execution payload filter using the agent user ID alongside idempotency tracking.

To keep the pipeline resilient, the Jira trigger passes event payloads into an n8n workflow configured as follows:

Jira Webhook Trigger: Captures issue update and comment events filtered directly by custom event types.

Filter Node: Validates that the event actor account ID matches the specific agent service account to prevent feedback loops.

Redis or Data Store Deduplication: Checks the issue key and update timestamp to ensure replayed webhooks do not send duplicate Slack alerts.

Notification & Logging: Formats a Slack block payload with direct review links and appends structured execution metadata into Google Sheets for performance tracking.

For full transparency, I am affiliated with Pond AI. Pond AI builds, runs and maintains custom AI agents for businesses. We map system architecture for free with blueprints you keep, backed by a 7 day refund policy on custom builds.

Are you managing webhook retries and payload deduplication inside n8n directly, or relying entirely on Jira retry headers?