---
title: Workflows & Templates
description: Build and execute multi-step automated pipelines with workflow templates.
tags:
  - workflows
  - templates
  - pipelines
  - automation
---

  intermediate

The ivybloom CLI is the scriptable surface for the platform, and workflows are where you turn a sequence of tools into a single automated pipeline — each step's output feeding the next without manual intervention. Reach for workflow templates when you want a reproducible, multi-step drug discovery pipeline you can list, manage, and execute from scripts or CI/CD rather than driving each tool by hand. For the full command surface, see the [CLI overview](/docs/cli).

## Workflows & Templates

Build and execute multi-step automated pipelines with workflow templates.

---

## Overview

A workflow is a YAML or JSON file that lists jobs, their parameters and their `depends_on` order. The CLI generates the file, validates it and runs it. Each job can read an earlier job's output (for example `structure_source: job1.output`).

---

## Workflow Files

### Create a Workflow File

```bash
ivybloom workflows create my_pipeline.yaml
ivybloom workflows create my_pipeline.json --format json
```

The generated file looks like this:

```yaml
name: My Workflow
description: Description of what this workflow does
version: "1.0"
jobs:
    - id: job1
      name: First Job
      tool: esmfold
      parameters:
        sequence: MKFLILLFNILCLFPVLAADNHGVGPQGAS
    - id: job2
      name: Second Job
      tool: docking
      parameters:
        ligand_source: uploaded_file.sdf
        structure_source: job1.output
      depends_on:
        - job1
options:
    parallel: false
    on_failure: stop
    timeout: 3600
    max_retries: 2
    retry_delay: 60
```

### Validate a Workflow File

```bash
ivybloom workflows validate my_pipeline.yaml
```

---

## Workflow Templates

### List Available Templates

```bash
ivybloom workflows templates
ivybloom workflows templates --category discovery
```

Categories: `discovery`, `optimization`, `design`, `assessment`, `synthesis`.

### View Template Details

```bash
ivybloom workflows template TEMPLATE_ID
```

Shows the template's parameter schema, steps, dependencies and estimated duration.

> `ivybloom templates` is a different command. It manages session templates (a tool list, model and system prompt for a chat session), not workflow templates.

---

## Listing Workflows

```bash
ivybloom workflows list
ivybloom workflows list --format json
```

The CLI command has no project filter. The `workflows_list` MCP tool accepts an optional `project_id`.

---

## Executing Workflows

### From the CLI

```bash
# Show the execution plan without running
ivybloom workflows run my_pipeline.yaml --dry-run

# Run, wait for every job, and attach to a project
ivybloom workflows run my_pipeline.yaml --wait --project-id PROJECT_ID

# Run independent jobs in parallel
ivybloom workflows run my_pipeline.yaml --parallel
```

### Via MCP

`ivybloom mcp serve` exposes workflow tools to AI agents: `workflows_list`, `workflows_get`, `workflows_create`, `workflows_execute`, `workflows_results`, `workflows_templates` and `workflows_template_get`.

```
MCP tool: workflows_execute
Parameters: workflow_id (required), inputs, parameters
```

### Via Orchestration

Use natural language to trigger multi-step work:

```bash
ivybloom orchestrate "Fold EGFR, find binding sites, and dock erlotinib"
```

The orchestrator chains the tools it picks. See [Orchestration](/docs/cli/orchestration) for details.

---

## Workflow Results

Per-workflow details and step results are available through the `workflows_get` and `workflows_results` MCP tools. The CLI has no `workflows get` or `workflows results` subcommand; use `ivybloom jobs list` and `ivybloom jobs download JOB_ID` for the jobs a run submitted.

---

## Pipeline Examples

### Structure-Based Drug Discovery

 B["ESMFold<br/>structure.pdb"]
    B --> C["ProteinPrep<br/>prepared.pdb + binding sites"]
    C --> D["DiffDock<br/>docking_poses.sdf + scores"]
    D --> E["ADMET<br/>drug-likeness report"]`}
  caption="Structure-based drug discovery: fold, prepare, dock, then profile drug-likeness."
/>

### High-Throughput Screening

 B["Batch ADMET<br/>filtered_hits"]
    B --> C["Batch docking<br/>scored_poses"]
    C --> D["Export<br/>results.csv"]`}
  caption="High-throughput screening: filter a library on ADMET, dock the survivors, then export."
/>

See [Recipes](/docs/cli/recipes) for step-by-step walkthroughs of these pipelines.

---

## Read next

- [Orchestration](/docs/cli/orchestration) — Natural language workflow execution
- [Batch Processing](/docs/cli/batch) — Parallel job collections
- [MCP Integration](/docs/cli/mcp) — AI agent workflow execution
- [Recipes](/docs/cli/recipes) — Step-by-step workflow tutorials
- [Commands Reference](/docs/cli/commands) — Full command documentation
