AAurora Workflows
Get started
Documentation

Workflow Hosting

Run published workflows on a SQL Server backed hosting engine – scheduled, monitored and controlled directly from the designer.

What is Workflow Hosting?

The Hosting Engine is a headless .NET 10 service that executes compiled .awfc workflows stored in a SQL Server database. Instead of copying bundles to a machine and starting the CLI Runner by hand, you publish a workflow straight into the hosting database. One or more hosting nodes pick it up, schedule it, run it, record its status and restart it when it fails.

Hosting complements the existing execution options:

OptionBest for
Designer (F5)Building and debugging a workflow interactively.
CLI RunnerRunning a single .awfc from a shell, a scheduled task or a CI pipeline.
Hosting EngineOperating many workflows continuously on one or more servers with central status, scheduling and retries.

How It Works

  1. The designer compiles the open workflow into an .awfc container and stores it – together with its execution options – in the hosting database (publish target Hosting Database).
  2. Every running hosting node registers itself in the database and reports a health check and a performance score periodically.
  3. The Scheduler (executed by the elected master node) assigns workflows with status New to a compatible node.
  4. The Orchestrator on that node starts a dedicated Executor process per workflow (--executeWorkflow <id>). A global mutex guarantees that a workflow id never runs twice on the same machine.
  5. The executor loads the container, restores NuGet packages into .packages/, runs the workflow and writes task/trigger state plus health checks back to the database.
  6. After completion the status becomes Stopped (or Error); repeating and cron workflows are re-queued automatically.
Fault tolerance: Workflows whose executor stops reporting health checks (crash, killed node, network partition) are detected as orphaned by the master and re-queued without consuming a retry. Retries only apply to real error states.

Schedule Behaviors

BehaviorDescription
Single (default)Runs once. Afterwards the workflow stays Stopped until you start it again.
MultipleMay run on several nodes at the same time.
RepeatingRe-queued immediately after every run – suited for long-running workflows with their own triggers.
CronStarted according to a cron expression, e.g. 0 */5 * * * *.

Tags and Load Balancing

Each node advertises tags that describe its capabilities (for example windows;gpu;reporting). Initial tags are configured in appsettings.json (SchedulerOptions:CustomTags); afterwards the value in the database is authoritative and can be changed at runtime.

When publishing you can require tags for a workflow. The scheduler applies these rules:

  • Workflows without tags are scheduled by the master node.
  • Workflows with tags are scheduled by the master as long as it provides all of them.
  • If the master is incompatible, the compatible node with the best performance score takes over.
  • If no active node is compatible, the workflow is not scheduled and a warning is logged.

Workflow Status Values

StatusMeaning
NewWaiting to be scheduled.
Scheduling / ScheduledThe scheduler is assigning the workflow to a node.
Orchestrating / OrchestratedThe node is starting the executor process.
Started / RunningThe workflow is executing.
StoppedFinished or stopped on request.
PausedStored but excluded from scheduling.
Error / SchedulingErrorFailed; retried automatically while Retries < Max retries.
LoadErrorThe executor could not load the container within the configured load timeout (missing assembly or package, blocked resolver). The process exits and releases the workflow; fix the container and update it from the designer.
Upgrading / UpgradeErrorThe container is being replaced by a newer version from the designer.
Workflow identity: Besides the database id every hosted workflow carries the content workflow id of the container it was published from. Update current and Save to host match the editor content against this id, so a workflow can be re-published or hot-patched without knowing its database id. Use Workflow → New Workflow Id in the ribbon (only while stopped) when you copy a design and want it to become an independent hosted workflow.

The Workflow Hosting Panel

Workflow Hosting panel in the desktop application
The Workflow Hosting panel lists hosted workflows and nodes, lets you edit execution options and opens hosted workflows directly in the editor.

Open the panel via Panels → Workflow Hosting in the ribbon. It connects to a hosting engine (any publish target that supports host control) and shows:

  • Connection – the selected host and its connection options (server, database, authentication). Settings are remembered between sessions; passwords are not.
  • Workflows – name, status, schedule, current task, retries, tags and modification date of every hosted workflow. The details show orchestrator, executor, last health check, execution times and the last error.
  • Execution options – schedule, cron expression, max. retries and node tags of the selected workflow. Edit them in place and click Apply; the container content is not touched and a running workflow picks the new values up on its next run. Reset discards the edits.
  • Nodes – all registered hosting nodes with type, role (master/backup), host name, performance score, tags and last-seen time.
ActionEffect
StartQueue the selected workflow for execution (from paused / stopped / error).
StopRequest the running workflow to stop.
PauseTake the workflow out of the scheduler queue without deleting it.
DeleteRemove the workflow from the host.
Open in editorDownload the selected hosted workflow (or double-click it) and open it in the editor. The workflow currently open is replaced after confirmation.
Update selectedReplace the selected hosted workflow with the workflow open in the editor. Execution options are kept; a running workflow is stopped, updated and restarted. You are warned if the workflow ids differ.
Update currentUpdate the hosted counterpart of the workflow open in the editor (matched by content workflow id).
Queue after updateQueue an idle workflow right after the update; otherwise it is stored paused. Running workflows are always restarted.
Apply / ResetSave the edited execution options to the host or discard the edits.
AutoRefresh the lists every 5 seconds (enabled by default).

Editing Hosted Workflows (Round Trip)

Published containers carry the complete designer graph, so a hosted workflow can be edited without its original .awf file. After Open in editor the window title shows [Host: Workflow] instead of a file name and the editor remembers where the content came from.

Save to host confirmation when saving a workflow opened from a host
Saving a workflow that was opened from a host pushes it back to the host after confirmation.
  1. Select the hosted workflow and click Open in editor (or double-click it).
  2. Edit tasks, connections and packages as usual. Test it with F5 in the designer if needed.
  3. Press Ctrl+S. Instead of writing a file the editor asks Save to host: the hosted content is replaced; a running workflow is stopped, updated and restarted. Execution options stay unchanged and embedded assemblies/packages that are not available locally are preserved (patch).
  4. Use File → Save As to write the content to an .awf or .awfc file instead. Saving to a file detaches the editor content from the host; use Update selected later to push it again.
Tip: Containers published before designer data was embedded can still be opened – the graph is reconstructed from the compiled workflow and laid out automatically. Save it once to store the designer data.

Publishing to a Host

In the Publish panel choose the Hosting Database target. Its options are grouped:

GroupOptionDescription
DatabaseServerSQL Server instance, e.g. myserver\instance,1433.
DatabaseDatabase name (default svc.auroraworkflows).
AuthenticationWindows or SQL Server.
User name / PasswordSQL credentials. The password is not stored between sessions.
Trust server certificateAccept the server certificate without validation (encrypted connection).
ExecutionScheduleSingle, Multiple, Repeating or Cron (see above).
Cron expressionOnly used for schedule Cron.
Max retriesNumber of automatic re-runs after an error (0 = none).
TagsRequired node tags, separated by ; or ,. Leave empty for any node.
BehaviorActivatePublish with status New so the scheduler starts it right away; otherwise it is stored as Paused.
OverwriteReplace a workflow with the same id and reset its runtime state.

Use Test to verify the connection before publishing. Since hosting nodes restore NuGet packages themselves, you usually only need to embed assemblies that are not available as packages.

Running a Hosting Node

The hosting node is the console application Aurora.Workflows.Hosting.Cli (.NET 10). It is configured through appsettings.json:

{
  "ConnectionStrings": {
    "Database": "Server=myserver;Database=svc.auroraworkflows;Trusted_Connection=True;TrustServerCertificate=True"
  },
  "SqlServerOptions": { },
  "SchedulerOptions": {
    "CustomTags": "windows;gpu"
  },
  "ResilienceOptions": {
    "MaxDatabaseConnectionRetries": 5,
    "DatabaseRetryDelaySeconds": 5,
    "WorkflowLoadTimeoutSeconds": 300
  },
  "Serilog": { ... }
}
OptionDescription
MaxDatabaseConnectionRetriesConsecutive failed database round trips a component tolerates before it shuts itself down. A successful round trip resets the counter, so short outages are survived.
DatabaseRetryDelaySecondsDelay between two connection attempts after a failed round trip.
WorkflowLoadTimeoutSecondsMaximum time an executor waits for the container to load (assembly resolution, NuGet restore). Exceeding it sets the workflow to LoadError and terminates the executor instead of leaving a zombie process.

Start the node with Aurora.Workflows.Hosting.Cli.exe. On first start the database schema is created/migrated automatically. The node then acts as scheduler, orchestrator and executor host in one process and spawns a separate executor process per workflow. Logs are written to the console and to log/log.log with daily rolling.

Multiple nodes: Start the same application on several machines pointing to the same database. The nodes elect a master deterministically by performance score; a healthy master is only replaced when a candidate beats it by a clear margin, so roles do not flip back and forth. Backup nodes take over scheduling based on tags and performance score.
Process supervision: Executors watch their parent node process and exit when it disappears; the node in turn terminates its executors on shutdown. Stop requests (Ctrl+C, service stop, container stop) are graceful – running workflows are stopped and their state is persisted before the process exits with a meaningful exit code.

Running the Node as a Service

For production use the node should start automatically and survive reboots. The hosting node is a plain .NET console application without a UI, so it runs on Windows and Linux alike – as a Windows service, as a Docker container or under any other process supervisor.

Windows Service with NSSM

NSSM (the Non-Sucking Service Manager) wraps any executable as a Windows service and restarts it when it exits. Publish the node first, then register it:

dotnet publish Aurora.Workflows.Hosting.Cli -c Release -r win-x64 --self-contained false -o C:\AuroraHosting

nssm install AuroraWorkflowsHost "C:\AuroraHosting\Aurora.Workflows.Hosting.Cli.exe"
nssm set AuroraWorkflowsHost AppDirectory "C:\AuroraHosting"
nssm set AuroraWorkflowsHost DisplayName "Aurora Workflows Hosting Node"
nssm set AuroraWorkflowsHost Description "Schedules and executes published Aurora workflows"
nssm set AuroraWorkflowsHost Start SERVICE_AUTO_START
nssm set AuroraWorkflowsHost AppExit Default Restart
nssm set AuroraWorkflowsHost AppRestartDelay 5000
nssm set AuroraWorkflowsHost AppStdout "C:\AuroraHosting\log\service.out.log"
nssm set AuroraWorkflowsHost AppStderr "C:\AuroraHosting\log\service.err.log"

nssm start AuroraWorkflowsHost
  • AppDirectory must point to the publish folder so appsettings.json, the .packages cache and the log folder are resolved relative to the node.
  • Use nssm set AuroraWorkflowsHost ObjectName "DOMAIN\svc-aurora" "password" to run under a dedicated account – required for Windows authentication against SQL Server. Grant that account write access to the publish folder.
  • Settings can also be supplied as environment variables instead of editing appsettings.json, e.g. nssm set AuroraWorkflowsHost AppEnvironmentExtra ConnectionStrings__Database="Server=…" SchedulerOptions__CustomTags="windows;gpu".
  • Tasks that interact with the desktop (screen capture, keystrokes, Selenium with a visible browser) do not work in session 0. Run such workflows on a node started interactively or use tags to keep them away from service nodes.
  • nssm edit AuroraWorkflowsHost opens a GUI for the same options; nssm remove AuroraWorkflowsHost confirm uninstalls the service.

Docker Container (Linux or Windows)

The project ships a multi-stage Dockerfile in Aurora.Workflows.Hosting.Cli based on the official mcr.microsoft.com/dotnet/runtime:10.0 image. Build it from the repository root so the shared Directory.Build.props / Directory.Packages.props are included:

docker build -f Aurora.Workflows.Hosting.Cli/Dockerfile -t aurora-hosting:latest .

Run a node and pass the configuration as environment variables (double underscores map to configuration sections):

docker run -d --name aurora-node-1 --restart unless-stopped \
  -e ConnectionStrings__Database="Server=sql.example.local,1433;Database=svc.auroraworkflows;User Id=aurora;Password=***;TrustServerCertificate=True" \
  -e SchedulerOptions__CustomTags="linux;docker" \
  -v aurora-packages:/app/.packages \
  -v aurora-logs:/app/log \
  aurora-hosting:latest

Or with docker compose, including a SQL Server for a self-contained test environment:

services:
  sql:
    image: mcr.microsoft.com/mssql/server:2022-latest
    environment:
      ACCEPT_EULA: "Y"
      MSSQL_SA_PASSWORD: "Your_strong_Passw0rd"
    ports: ["1433:1433"]
    volumes: ["sql-data:/var/opt/mssql"]

  node:
    build:
      context: .
      dockerfile: Aurora.Workflows.Hosting.Cli/Dockerfile
    depends_on: [sql]
    restart: unless-stopped
    environment:
      ConnectionStrings__Database: "Server=sql;Database=svc.auroraworkflows;User Id=sa;Password=Your_strong_Passw0rd;TrustServerCertificate=True"
      SchedulerOptions__CustomTags: "linux;docker"
    volumes:
      - aurora-packages:/app/.packages
      - aurora-logs:/app/log

volumes:
  sql-data:
  aurora-packages:
  aurora-logs:

Scale out with docker compose up -d --scale node=3 – every container registers as its own node against the same database.

  • Cross-platform: the hosting engine, the core libraries and the general task packages are platform independent. Task packages that depend on Windows APIs (Aurora.Workflows.Tasks.Windows, Hardware, parts of Selenium) only run on a Windows node – use tags (e.g. windows) when publishing such workflows so the scheduler never assigns them to a Linux container.
  • Windows containers: switch the base images to mcr.microsoft.com/dotnet/runtime:10.0-windowsservercore-ltsc2022 and mcr.microsoft.com/dotnet/sdk:10.0-windowsservercore-ltsc2022 in the Dockerfile and build on a Windows Docker host. Alternatively set <DockerDefaultTargetOS>Windows</DockerDefaultTargetOS> in the project and let Visual Studio generate the image.
  • Persist volumes: mount /app/.packages so NuGet packages are not downloaded again after each container restart, and /app/log for the Serilog files.
  • Publishing from the designer: the designer only needs network access to the SQL Server; the containers pick up the workflow on their own. Workflows from the designer are published with the Hosting Database target exactly as described above.
  • Instead of NSSM or Docker you can also use systemd on Linux: create a unit with ExecStart=/usr/bin/dotnet /opt/aurora/Aurora.Workflows.Hosting.Cli.dll, WorkingDirectory=/opt/aurora and Restart=always.

Projects

AssemblyTargetDescription
Aurora.Workflows.Hosting.Contracts.NET 10Enums and command line parameters shared by hosting components
Aurora.Workflows.Hosting.Core.NET 10EF Core data model, Scheduler, Orchestrator, Executor and performance monitor services
Aurora.Workflows.Hosting.Publisher.NET 10Hosting Database publish target and host controller used by the designer
Aurora.Workflows.Hosting.Cli.NET 10Hosting node executable
The Workflow Hosting PanelEditing Hosted WorkflowsPublishing to a Host