New Tool Radar

AI Agents & Automation

How to Notify the Owner When an Agent Run Completes or Fails

Notify the owner when an agent run completes or fails, so no run ends silently.

Schematic with three steps: Add the notification step after the run,; Include the run id, the outcome, and; Test by failing a run on purpose.

A run that ends silently is a run nobody knows about: a success nobody uses, or a failure nobody fixes. A completion notification closes the loop, telling the owner what ran, what changed, and what failed, in one short message. n8n’s execution model already records each run, and a notification step after the run turns that record into something the owner actually sees. Send the notification for failures and for successes alike, because a success-only notification teaches the owner that no message means a failure, and a failure-only notification teaches them that no message means success. Keep it short: run id, outcome, and the one line that matters.

What you need

  • An agent run with a known owner, and a channel to reach them
  • A notification step that runs after the agent run ends, whatever the outcome
  • A short notification shape: run id, outcome, what changed or failed

Step 1: Add the notification step after the run, not inside it

Put the notification where it runs when the agent run ends, whether it succeeded or failed. A notification inside the run is skipped when the run fails early.

Step 2: Include the run id, the outcome, and the one line that matters

Write the notification as three items: the run id so it can be traced, the outcome, and the single most important line, such as the number of records updated or the error that stopped the run.

Step 3: Test by failing a run on purpose

Run a task that fails and confirm the owner gets a failure notification with the run id and the error. Then run a task that succeeds and confirm the success notification arrives too.

Worked example: synthetic run notification check

The table below is a synthetic example. It shows the expected result of run notifications; no message was sent.

Run outcome Notification sent? Carries run id?
Success, 12 records updated Yes Yes
Failure, tool timed out Yes Yes
Run cancelled by user Yes Yes
No run ends silently Yes Pass

Expected result (UNTESTED). every run, success, failure, or cancelled, sends a short notification carrying its run id. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • A notification that nobody reads is the same as no notification, so send it where the owner actually looks.
  • Too many notifications teach the owner to ignore them; one per run, not one per step.
  • The notification must not contain secrets or personal data; keep it to ids and outcomes.
  • A notification step that itself fails should not fail the run it reports on.

Sources

See all