WorkflowsRunning workflows

Running workflows

Run Runiq workflows through the runtime or dashboard API.

Workflows run through IWorkflowExecutionRuntime.

The runtime executes each workflow step in order, passing the previous step output as the next step input.

Use sample workflows to prove the orchestration behavior, not to prescribe a product domain. Runiq.WorkflowTravelPlanner is useful because it has clear stages, but the same runtime call can sit behind an internal approval flow, a customer support assistant, an incident response workflow, or any other .NET endpoint.

Run from application code

C#
using Runiq.Workflows;

app.MapPost("/travel-plan", async (
    TravelPlanRequest request,
    WorkflowRegistry registry,
    IWorkflowExecutionRuntime runtime,
    CancellationToken cancellationToken) =>
{
    var workflow = registry.FindById("travel-planning-workflow");

    if (workflow is null)
    {
        return Results.NotFound();
    }

    var result = await runtime.ExecuteAsync(
        workflow,
        request.Message,
        cancellationToken);

    return Results.Ok(new
    {
        status = result.Status.ToString(),
        finalOutput = result.FinalOutput,
        errorMessage = result.ErrorMessage,
        steps = result.StepResults.Select(step => new
        {
            step.StepId,
            status = step.Status.ToString(),
            step.Input,
            step.Output,
            step.ErrorMessage
        })
    });
});

public sealed record TravelPlanRequest(string Message);

Dashboard run endpoint

With dashboard path /dashboard, Runiq maps:

HTTP
POST /dashboard/api/workflows/{workflowId}/run
Content-Type: application/json

{
  "input": "Create a practical two-day Istanbul trip plan. Keep it low-fatigue."
}

The response includes workflow status, final output, step results, and tool calls captured inside each agent step.

JSON
{
  "workflowId": "travel-planning-workflow",
  "status": "Completed",
  "finalOutput": "...",
  "errorMessage": null,
  "steps": []
}

Step input and output

Each successful step output becomes the next step input.

That means a workflow is not just parallel execution. It is a deterministic chain of agent contributions. Weather Agent can produce weather context, Places Agent can receive it and produce place context, and Planner Agent can receive the latest output and create the final answer.

Use workflow steps when intermediate outputs matter.

This is where workflows differ from a single agent with many instructions. The application can persist or inspect each stage, compare outputs across runs, and decide whether a failed step should stop the process or allow a later step to continue with partial context.

On this page