Table of Contents

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

task AgentTaskDefinition

The task definition to run.

source TaskTriggerSource

Identifies how the task was triggered.

parameters IReadOnlyDictionary<string, JsonElement>?

Validated external trigger parameters to capture with the run.

ct CancellationToken

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.