Getting Started
This guide walks through installing FlowState, creating a workflow, and running it.
Installation
Section titled “Installation”Prerequisites
Section titled “Prerequisites”- .NET 9.0 SDK or later
- macOS or Linux (Windows support is experimental)
Build from Source
Section titled “Build from Source”# Clone the repositorygit clone https://github.com/your-org/flowstate.gitcd flowstate
# Build the projectdotnet build -c Release
# Install globally./install.shThe install script copies the binary to ~/.local/bin/fs. Ensure this directory is in your PATH.
Verify Installation
Section titled “Verify Installation”fs --helpYou should see available commands: run, list, resume.
Workflow Discovery
Section titled “Workflow Discovery”FlowState searches for workflows in these locations (in order):
- Project directory:
./.flowstate/ - User directory:
~/.flowstate/
Workflows can be defined as:
- Folder-based:
.flowstate/my-workflow/index.yaml(recommended for complex workflows with bundled files) - File-based:
.flowstate/my-workflow.yaml(simpler, single-file workflows)
Project workflows take precedence over user workflows with the same name.
Your First Workflow
Section titled “Your First Workflow”Create a simple workflow that demonstrates core concepts.
Create the Workflow
Section titled “Create the Workflow”mkdir -p .flowstate/hello-worldCreate .flowstate/hello-world/index.yaml:
name: hello-worldstart-at: greet
states: greet: tool: bash arguments: command: echo "Hello from FlowState!" next: ask-name
ask-name: tool: ask-user arguments: question: "What is your name?" output: var(name) next: personalize
personalize: tool: bash arguments: command: 'echo "Nice to meet you, {{ name }}!"'Run the Workflow
Section titled “Run the Workflow”fs run hello-worldFlowState will:
- Prompt for an instance name (or generate one)
- Execute
greet- prints “Hello from FlowState!” - Execute
ask-name- prompts for your name, stores innamevariable - Execute
personalize- greets you by name - Complete and optionally clean up the instance
Examine the Instance
Section titled “Examine the Instance”Before the workflow completes, the instance directory at .flowstate/instances/<instance-name>/ contains:
workflow/ index.yaml # Copy of the workflow definitioncontext.json # Execution state and variablesThe context.json tracks the current state, variables, and status.
Running Workflows
Section titled “Running Workflows”Interactive Mode
Section titled “Interactive Mode”fs run my-workflowIf instances exist, you can choose to resume one or create new.
Create Named Instance
Section titled “Create Named Instance”fs run my-workflow --name my-instanceCreates a new instance with the specified name. Fails if the name already exists.
Resume Existing Instance
Section titled “Resume Existing Instance”fs run my-workflow --resume my-instanceContinues execution from where the instance left off.
Non-Interactive Mode
Section titled “Non-Interactive Mode”For CI/CD or scripts, always specify --name or --resume:
fs run my-workflow --name build-$(date +%Y%m%d)Cleanup on Completion
Section titled “Cleanup on Completion”fs run my-workflow --clean-on-endAutomatically deletes the instance directory on successful completion.
Listing Workflows
Section titled “Listing Workflows”See all available workflows:
fs listOutput shows workflow names and inheritance relationships:
Workflows: hello-world code-review (extends new-feature) new-featureNext Steps
Section titled “Next Steps”- States - Deep dive into state definitions
- Variables - Variable substitution and output capture
- Error Handling - Graceful failure recovery