Repository navigation
How to Access Payload Parameter in IEventPublisher.PublishAsync #6469
Replies: 1 comment
|
For example, publish a typed/anonymous payload to the waiting workflow instance: await eventPublisher.PublishAsync(
"ButtonClicked",
workflowInstanceId: result.WorkflowState.Id,
payload: new { MyKey = "MyValue" },
cancellationToken: cancellationToken);The The same pattern, including an example for a following decision activity, is covered in discussion #6898. Relevant source: Closing this Q&A as answered. |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am working with Elsa Workflows and trying to access the payload parameter when publishing an event using
IEventPublisher.PublishAsync. My goal is to retrieve the payload in the workflow when the event is triggered.Here’s my workflow definition:
I am triggering the event with the following code:
Issue:
I want to retrieve myPayload inside my workflow when the "ButtonClicked" event is received. How can I access the payload parameter from IEventPublisher.PublishAsync inside my workflow?
Any guidance or code examples would be greatly appreciated.
Thanks in advance!
All reactions