Introduce the ability to pass variables into workflow invocations. Updates include adding variables to workflow execution options, requests, and scheduling logic. This enhancement allows dynamic variable management during workflow execution and instance creation.
20 lines
768 B
C#
20 lines
768 B
C#
namespace Elsa.Workflows.Runtime;
|
|
|
|
public class TriggerInvoker(IWorkflowStarter workflowStarter) : ITriggerInvoker
|
|
{
|
|
public async Task<StartWorkflowResponse> InvokeAsync(InvokeTriggerRequest request, CancellationToken cancellationToken = default)
|
|
{
|
|
var startRequest = new StartWorkflowRequest
|
|
{
|
|
Workflow = request.Workflow,
|
|
CorrelationId = request.CorrelationId,
|
|
Input = request.Input,
|
|
Variables = request.Variables,
|
|
Properties = request.Properties,
|
|
ParentId = request.ParentWorkflowInstanceId,
|
|
TriggerActivityId = request.ActivityId,
|
|
};
|
|
|
|
return await workflowStarter.StartWorkflowAsync(startRequest, cancellationToken);
|
|
}
|
|
} |