Skip to main content

Raising task events

This section provides information on how to raise task events.

Task events are part of the Durable Steps & Workflow API and can be awaited for in a Waiting for external events step.

API reference:

Required scopes:

  • Data/Buildby.Taskurai/events/create

Prerequisites

Raising an external event

Events can be raised by any system or code that is activated by human interaction. The task id must be the id of the task waiting for the external event. The event data return can be any serializable type.

// Setup Taskurai client
var taskId = "5e7f3b48-8914-478e-8b6c-35c8d5924c7a"; // Task waiting for external events

await taskurai.RaiseTaskEventAsync(
id: taskId,
eventName: "managerApprovalEvent",
eventData: true, // Return true
cancellationToken: ct
);