<@ULVA73B9P> How to pass event payload to an autom...
# ask-marvin
l
@Marvin How to pass event payload to an automation?
n
i think you're doing it right, but you need to wrap that in double quotes
also sorry, marvin is currently down
l
Hmm the flow doesn't start if i do that and this is my event structure:
{
"id": "807339c0-17e5-4ad4-aa0a-a8b2eb187862",
"event": "Trigger direct freight search",
"occurred": "2025-10-14T13:47:05.145Z",
"payload": {
"tab_id": "1",
"tenant_ref": "2",
"search_hash": "3",
"session_hash": "4",
"search_criteria": "whatever"
},
"received": "2025-10-14T13:48:00.308Z",
"related": [],
"resource": {
"prefect.resource.id": "custom.api.trigger",
"prefect.resource.role": "api"
}
}
Thanks for replying anyway.
n
if you want to share your trigger definition and a raw event as visible from the Event Feed, i can probably tell why it might not be firing
l
This is the trigger definition:
{
"type": "event",
"match": {
"prefect.resource.id": [
"custom.api.trigger"
]
},
"match_related": {},
"after": [],
"expect": [
"Trigger direct freight search"
],
"for_each": [],
"posture": "Reactive",
"threshold": 1,
"within": 0
}
n
so
expect
should be something like
Copy code
prefect.flow-run.Completed
ie it should be the event that you are `expect`ing to see
if you're emitting a custom event like
foo.bar.baz
then you'd
expect={"foo.bar.baz"}
l
Yeap, that part works, i mean if i pass a dummy payload, i can trigger the flow by sending an event, so the match between event and flow works but i am not able to access the event's data, e.g. this payload successfully triggers and completes a flow:
n
does this help?
l
I magically made it work with 😅:
{
"payload": {{ event.payload | tojson }}
}
The UI for automations is a bit confusing and it would help a lot if there are more examples in the docs but thanks a lot for your time and help! 🙂 🙏
n
yep we should have another example in the docs for this! thanks for the feedback
prefect rocket 1
l
@Nate That's very helpful, thanks for reacting so fast and updating the docs! prefect rocket
catjam 1