Skip to main content

Agent Workflows

Deprecated. This package targets the legacy Spaik block protocol and does not support Spaik 1.0/AG-UI. Version 0.3.2 is the final planned compatibility patch, pinned to spaik-sdk==0.11.1 and spaik-coding-agents==0.2.3; keep it in a separate environment from Spaik 1.0. Existing PyPI artifacts and tagged source remain available. With Spaik 1.0, orchestrate steps in application code using BaseAgent and ToolProvider.

YAML-driven workflow engine for AI agents.

Spaik SDK is an open-source project developed by engineers at Siili Solutions Oyj. This is not an official Siili product.

Installation

# Install globally with uvx (recommended)
uvx --from "spaik-agent-workflows==0.3.2" spaik-agent-workflows --help

# Or install with pip in an environment without Spaik 1.0
pip install "spaik-agent-workflows==0.3.2"

# Or install locally for development
cd packages/agent-workflows
uv sync

Quick Start

# Run a workflow by name
spaik-agent-workflows my-workflow --param value

# List all available workflows
spaik-agent-workflows --list

# Validate a workflow without running
spaik-agent-workflows my-workflow --validate

# Show help
spaik-agent-workflows --help

Workflow Discovery

Workflows are discovered from multiple locations (in order):

  1. Current directory: ./workflow-name.yml, ./workflow-name.yaml, etc.
  2. Local workflows dir: ./.agent_workflows/workflow-name.yml
  3. Global config: ~/.config/spaik-agent-workflows/workflow-name.yml
  4. Bundled: Workflows shipped with the package

Supported extensions: .yml, .yaml, .agent-workflow.yml, .agent-workflow.yaml

Environment Variables

Environment files are loaded in order (later overrides earlier):

  1. ~/.config/spaik-agent-workflows/.env (global)
  2. ./.env (current directory)
  3. --env-file <path> (explicit)

Workflow Format

Create my-workflow.yml:

name: my-workflow
env:
  API_KEY: ${{ env.MY_API_KEY }}

vars:
  project_name: my-project

jobs:
  setup:
    steps:
      - uses: terminal/run
        with:
          command: npm install

  generate:
    needs: setup
    steps:
      - uses: agents/claude_code
        with:
          prompt: "Create a README for ${{ vars.project_name }}"
          cwd: "."

  test:
    needs: generate
    steps:
      - uses: terminal/run
        with:
          command: npm test

CLI Options

Option Description
--list List available workflows
--validate Validate workflow without running
--env-file PATH Load environment from file
-w, --workspace DIR Set workspace directory
--set PLUGIN.KEY=VALUE Override step values
--var KEY=VALUE Set workflow variables
--dest PATH Shorthand for git/download.dest

You can also pass variables as positional args:

spaik-agent-workflows apply-template --template agent --path ./my-agent

Built-in Plugins

Terminal

# Run shell commands
- uses: terminal/run
  with:
    command: "echo hello"
    shell: true              # optional, default true
    continue_on_error: false # optional
    timeout: 30              # optional, seconds

# Run scripts
- uses: terminal/script
  with:
    path: "./scripts/setup.sh"
    args: ["--verbose"]      # optional
    interpreter: "/bin/bash" # optional
    cwd: "."                 # optional

Git

# Clone/download from repository
- uses: git/download
  with:
    repo: "https://github.com/user/repo.git"
    ref: "main"              # optional branch/tag
    files:                   # optional, specific files/dirs
      - "templates/agent"
    dest: "./output"         # destination directory

# Push changes
- uses: git/push
  with:
    message: "chore: automated update"
    branch: "main"           # optional

Agents

# Claude Code agent (requires ANTHROPIC_API_KEY)
- uses: agents/claude_code
  with:
    prompt: "Implement feature X"
    cwd: "."                 # working directory

# General LLM agent (returns text response only)
- uses: agents/general
  with:
    prompt: "Analyze this code"
    system_prompt: "You are a code reviewer"  # optional
    output_var: analysis     # variable to store response

# Structured JSON response
- uses: agents/structured
  with:
    prompt: "Extract topics from this text: ..."
    schema:
      type: object
      properties:
        topics:
          type: array
          items:
            type: string
        summary:
          type: string
      required:
        - topics
        - summary
    output_var: extracted_data

Audio (Speech)

# Speech-to-text recording
- uses: audio/stt
  with:
    language: "en"           # optional
    output_var: "user_input" # variable to store result

# Text-to-speech
- uses: audio/tts
  with:
    text: "Hello, world!"
    voice: "alloy"           # optional
    output: "./output.mp3"   # optional

Variable Interpolation

Supports two syntaxes:

# GitHub Actions style
prompt: "${{ vars.name }} - ${{ env.API_KEY }}"

# Python format style
prompt: "{name} - {API_KEY}"

Custom Plugins

Create agent_workflows/plugins/my_namespace/my_plugin.py:

from typing import Any, Dict

async def execute(ctx: Dict[str, Any]) -> Dict[str, Any]:
    logger = ctx['logger']
    workspace = ctx['workspace']
    params = ctx.get('with', {})
    
    logger("Running my plugin...")
    
    # Do work...
    result = "some output"
    
    # Return values are available to subsequent steps
    return {"output": result}

Features

  • Parallel Execution: Jobs without dependencies run concurrently
  • DAG Support: Declare dependencies with needs:
  • Variable Interpolation: Use ${{ vars.x }} or {x} syntax
  • Environment Inheritance: Global → Job → Step
  • Run History: Track execution history in .agent-workflows/history/
  • Fail-fast: Stop on first error (configurable per step)

Development

cd packages/agent-workflows
uv sync --dev
uv run pytest tests/
uv run ruff check .
uv run ty check agent_workflows

License

MIT - Copyright (c) 2026 Siili Solutions Oyj

Metadata

Release files for spaik-agent-workflows 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spaik-agent-workflows 0.3.2
File Size Uploaded
spaik_agent_workflows-0.3.2.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spaik-agent-workflows 0.3.2
File Interpreter ABI Platform
spaik_agent_workflows-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 62.7 kB

Release files / spaik_agent_workflows-0.3.2.tar.gz

Download URL spaik_agent_workflows-0.3.2.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
38758101d3e5f60a32462ce4ba6831129451f83349648dc4b763fc0d8407cb3a
BLAKE2b-256 checksum
How to use checksums
3116c48f3ae58722437163485defd8a1c1bab91f594b87a58f2a03288c738ba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spaik_agent_workflows-0.3.2-py3-none-any.whl

Download URL spaik_agent_workflows-0.3.2-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f71583198a94e84d1289e7ef4660fc7285d204697fb362f41d4200cc46778241
BLAKE2b-256 checksum
How to use checksums
529404637b7e4cadf126a3d1af0cbd77b503bcbb13bdb8d2ec57052d5d1153bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page