Skip to content

feat(extensions): add ty-openworkflow for ephemeral compute workflows#390

Open
bborn wants to merge 1 commit intomainfrom
task/1014-openworkflow-extension
Open

feat(extensions): add ty-openworkflow for ephemeral compute workflows#390
bborn wants to merge 1 commit intomainfrom
task/1014-openworkflow-extension

Conversation

@bborn
Copy link
Owner

@bborn bborn commented Feb 5, 2026

Summary

  • Add ty-openworkflow extension following the OpenWorkflow architecture pattern
  • Enable tasks to spawn durable, fault-tolerant workflows on ephemeral compute platforms
  • Support for multiple compute backends: local exec, Docker, and Cloudflare Workers
  • Full TaskYou integration via CLI bridge for task tracking

Key Features

OpenWorkflow Architecture

Based on openworkflow/openworkflow:

  • Deterministic replay: Steps are memoized and can be replayed from any checkpoint
  • Durable sleep: Workflows can pause and resume across process restarts
  • Fault tolerance: Crashed workers are automatically recovered

Compute Adapters

Adapter Description Use Case
exec Local Node.js/Python processes Development, testing
docker Isolated containers Self-hosted production
cloudflare Cloudflare Workers (edge) Serverless, global distribution

TaskYou Integration

  • Workflows can be linked to tasks for tracking
  • Task status updates automatically when workflows complete/fail
  • Bridge communicates via ty CLI (sidecar pattern)

Files Changed

extensions/ty-openworkflow/
├── cmd/main.go              # CLI with serve, deploy, start, status commands
├── config.example.yaml      # Example configuration
├── internal/
│   ├── bridge/bridge.go     # TaskYou CLI bridge
│   ├── compute/
│   │   ├── compute.go       # Adapter interface
│   │   ├── exec.go          # Local process adapter
│   │   ├── docker.go        # Docker container adapter
│   │   └── cloudflare.go    # Cloudflare Workers adapter
│   ├── config/config.go     # Configuration handling
│   ├── runner/runner.go     # Workflow orchestration
│   └── state/state.go       # SQLite state management
└── README.md                # Documentation

Test plan

  • Unit tests pass for compute, config, and state packages
  • Binary compiles successfully
  • Manual test: deploy and run a workflow locally with exec adapter
  • Manual test: verify TaskYou task integration

Example Usage

# Initialize config
ty-openworkflow init

# Deploy a workflow
cat <<'WORKFLOW' | ty-openworkflow deploy my-workflow -f -
async function workflow(input, { step, sleep }) {
  const greeting = await step("greet", () => "Hello, " + input.name);
  await sleep("wait", 5000);
  return { message: greeting };
}
WORKFLOW

# Start a run linked to a task
ty-openworkflow start my-workflow -i '{"name": "World"}' --create-task

# Check status
ty-openworkflow status <run-id>

🤖 Generated with Claude Code

Add a new TaskYou extension that enables spawning durable workflows
on ephemeral compute platforms using the OpenWorkflow architecture.

Features:
- Pluggable compute adapters (exec, Docker, Cloudflare Workers)
- OpenWorkflow-style deterministic replay with step memoization
- Durable sleep that survives process restarts
- TaskYou integration via CLI bridge
- SQLite state management for workflow and run tracking
- Webhook server for receiving completion callbacks
- Background polling for status updates

Compute Adapters:
- exec: Local process execution (Node.js/Python)
- docker: Isolated container execution
- cloudflare: Serverless edge execution on Cloudflare Workers

The extension follows the same sidecar pattern as ty-email, running
as a separate process that communicates with TaskYou via the ty CLI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant