Skip to content

[CLEAN] Synthetic Benchmark PR #20227 - Link automation.action.* events to automation.triggered event#552

Open
tomerqodo wants to merge 6 commits intobase_pr_20227_20260121_5799from
clean_pr_20227_20260121_5799
Open

[CLEAN] Synthetic Benchmark PR #20227 - Link automation.action.* events to automation.triggered event#552
tomerqodo wants to merge 6 commits intobase_pr_20227_20260121_5799from
clean_pr_20227_20260121_5799

Conversation

@tomerqodo
Copy link

Benchmark PR PrefectHQ#20227

Type: Clean (correct implementation)

Original PR Title: Link automation.action.* events to automation.triggered event
Original PR Description: When an automation fires, it emits automation.triggered events, then queues
actions that emit automation.action.* events. Previously there was no way to
trace from automation.action.failed back to the automation.triggered event,
making debugging difficult.

Now automation.action.* events include a related resource with role
automation-triggered-event that links back to the state change event:

{
  "prefect.resource.id": "prefect.event.<id>",
  "prefect.resource.role": "automation-triggered-event"
}

This was requested via support to help with debugging automation failures at
higher volumes.

Port of https://github.com/PrefectHQ/nebula/pull/10911

🤖 Generated with Claude Code
Original PR URL: PrefectHQ#20227

chrisguidry and others added 6 commits January 21, 2026 15:45
When debugging automation failures at high volumes, it's difficult to trace
from an `automation.action.failed` event back to the `automation.triggered`
event that spawned it. This adds an `automation_triggered_event_id` field to
`TriggeredAction` and includes it as a related resource with role
`automation-triggered-event` on all action events (`.triggered`, `.executed`,
and `.failed`).

Port of https://github.com/PrefectHQ/nebula/pull/10911

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The triggering-event related resource should appear on all three action
event types (.triggered, .executed, .failed) to enable full traceability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Now that automation.action.executed and automation.action.failed events include
a triggering-event related resource, update the tests to expect it in their
assertions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Build related_resources once at the start of fail() and succeed() methods and
reuse it for both the .triggered and .failed/.executed events, rather than
building separate lists with identical logic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a brief section to the automations docs explaining the events emitted during
automation execution and the related resources (triggering-event and
automation-triggered-event) available for tracing action failures back to their
source.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the docs label Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants