---
name: bijection-workflow
description: "Evaluate and integrate the Workflow component with Bijection."
---

# Workflow

Durable workflow execution

- Package: @bijectionhq/workflow
- Category: Durable Functions
- Status: Included
- License: Apache-2.0
- Bijection source (repository access required): https://github.com/bijectionhq/workflow/tree/3e8a1c9ac959fed6d89720a9e472175936c83b38
- Upstream: https://github.com/convex/workflow/tree/4b629ebf2d871e50474ad1b9ce44b13a546982fa
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/workflow

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/workflow.git
cd workflow
git checkout 3e8a1c9ac959fed6d89720a9e472175936c83b38
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This source is included in Bijection's workspace. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @convex-dev/workflow. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


> Agents: read this skill fully before writing code that uses Workflow. Follow the installation and configuration steps exactly.

# Workflow

## Instructions

The Workflow component adds durable execution to Convex functions, allowing you to build reliable long-running processes that survive server restarts and handle failures gracefully. It combines queries, mutations, and actions into deterministic workflows with configurable retry policies, parallel execution, and reactive status monitoring. Workflows can run for months with custom delays, be canceled mid-execution, and provide real-time progress updates to multiple subscribers.

### Installation

```bash
npm install @convex-dev/workflow
```

Current npm version: `@convex-dev/workflow@0.4.10`

## Use cases

- **User onboarding flows** that span multiple days with email verification, content generation, and follow-up messages that must complete reliably
- **Data processing pipelines** that orchestrate multiple API calls, transformations, and database updates with automatic retries on transient failures
- **Payment and fulfillment workflows** that coordinate between payment processors, inventory systems, and shipping APIs with precise error handling
- **Content moderation systems** that combine AI analysis, human review queues, and notification steps with configurable delays between stages
- **Batch job orchestration** that processes large datasets by coordinating multiple parallel workers with backpressure and failure recovery

## How it works

You define workflows using `workflow.define()` with deterministic handler functions that orchestrate Convex queries, mutations, and actions through a step context. The component restricts access to non-deterministic APIs like `fetch` and patches others like `Math.random()` to ensure reproducible execution across server restarts.

Workflows are started from mutations or actions using `workflow.start()`, which returns a `WorkflowId` for tracking progress. Steps execute via `ctx.runQuery()`, `ctx.runMutation()`, and `ctx.runAction()` methods, with results passed between steps. Parallel execution happens through `Promise.all()` calls, while retry behavior is configured per-step or globally through workpool options.

The component provides reactive status monitoring through `workflow.status()`, cancellation with `workflow.cancel()`, and completion handling via `onComplete` callbacks. Failed workflows can be restarted from specific steps using `workflow.restart()`, and the system automatically manages step parallelism and resource cleanup.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Workflow is not needed

## Resources

- [npm package](https://www.npmjs.com/package/%40convex-dev%2Fworkflow)
- [GitHub repository](https://github.com/get-convex/workflow)
- [Convex Components Directory](https://www.convex.dev/components/workflow)
- [Convex documentation](https://docs.convex.dev)