Method TriggerTaskAsync
- Namespace
- Oscova.Agents.Tasks
- Assembly
- Oscova.Agents.dll
TriggerTaskAsync(AgentTaskDefinition, TaskTriggerSource, IReadOnlyDictionary<string, JsonElement>?, CancellationToken)
Queues an enabled task for immediate manual execution if it is not already running.
public Task<TaskTriggerOutcome> TriggerTaskAsync(AgentTaskDefinition task, TaskTriggerSource source = TaskTriggerSource.Manual, IReadOnlyDictionary<string, JsonElement>? parameters = null, CancellationToken ct = default)Parameters
taskAgentTaskDefinition-
The task definition to run.
sourceTaskTriggerSource-
Identifies how the task was triggered.
parametersIReadOnlyDictionary<string, JsonElement>?-
Validated external trigger parameters to capture with the run.
ctCancellationToken-
A token for cancelling pre-queue trigger work. Once queued, manual/webhook execution is owned by the scheduler.
Returns
- Task<TaskTriggerOutcome>
-
The trigger outcome, including the new or already-running run identifier.