Repository F# setup
open System
open System.IO
open System.Threading
open System.Threading.Tasks
open Axial
open Axial.Layers
open Axial.Console
open Axial.FileSystem
open Axial.Hosting
open Axial.Hosting.Browser
open Axial.Hosting.Node
open Axial.HttpClient
open Axial.PlatformService
open Axial.Process
open Axial.State
open Axial.Telemetry
open Axial.Telemetry.JavaScript

Running Flows

Creating a Flow does not execute it. Start it explicitly at a boundary:

let workflow = Flow.succeed "Hello"
let exit = workflow |> Flow.run ()
Execution completes with `Exit<'value, 'error>`:
match exit with
| Exit.Success value -> printfn "%s" value
| Exit.Failure cause -> printfn "%s" (Cause.prettyPrint string cause)
In a pipeline, use the module functions:
let exit = workflow |> Flow.run ()               // executes, blocks
let running = workflow |> Flow.startTask ()      // executes now, returns a handle
let cold = workflow |> Flow.toAsync ()           // executes nothing yet
The name states when work begins. `to*` builds a description and starts nothing, `start*` begins execution immediately and hands back a handle, and `run` executes to completion:
Entry point Starts work?
Flow.run / RunSynchronously Yes, and blocks until the Exit is available
Flow.startTask / StartAsTask / StartAsValueTask Yes — the work is already in flight when it returns
Flow.toAsync / ToAsync No — nothing runs until the returned async is started

This matters when you build a handle without awaiting it. StartAsTask has already begun the work at that point; ToAsync has not, and discarding the async discards the work.

The members carry optional cancellationToken and timeout arguments for interop callers; the module functions take none, which keeps the common path short. On Fable, use ToAsync.

Every call starts a fresh execution with its own root scope. Await the returned handle to receive the final Exit.

Direct execution is useful at interop boundaries. A complete application normally starts its root workflow with App.run, introduced at the end of this section.

Go Further