# Run a workflow from another

> Build a procedure once, such as "look up a customer", and use it as a step in any workflow. It takes inputs, hands back outputs, and doesn't count as an extra run.

Web page: https://docs.lodol.com/docs/guides/sub-workflows

A **Run a workflow** step runs another workflow in your workspace and waits for it to finish. Values go in through the inputs it declares, and its outputs come back as the step's result. Use it to build a procedure once and reuse it in many workflows, so a fix in one place fixes it everywhere.

<WorkflowPreview
  steps={[
    { step: 'New Stripe payment', app: 'Stripe', trigger: true },
    { step: 'Run a workflow', icon: 'Workflow', note: 'Look up customer' },
    { step: 'Send a message to a channel', app: 'Slack', note: '@customer.company' },
  ]}
/>

## What a workflow needs to be run this way

- It's **published** in the same workspace.
- It **doesn't start from a trigger or a schedule**: it runs on demand.
- It declares the [inputs](https://docs.lodol.com/docs/concepts/inputs-and-outputs.md) it needs and the outputs it hands back.

## Set up the step

Choose the workflow in **Workflow**, then give a value for each of its **Inputs**. Each value is checked against the type the workflow declared for it. Later steps read its outputs from the step's result, one field per output.

The step also keeps the workflow's name, so it still reads clearly if the workflow is renamed later.

## How it runs

- The workflow you call runs as part of this run, and gets its own entry in the run history.
- It doesn't count as a separate run on your plan.
- A workflow can't run itself, or any workflow already in the chain of calls that led to it.

## Give an AI agent a procedure

A workflow that can be run this way can also be one of an [AI agent's tools](https://docs.lodol.com/docs/guides/ai-agents.md#tools). The agent fills in the inputs and reads the outputs, so it follows your procedure exactly instead of improvising one.

## Reference

Every field of the step is on the [Workflows](https://docs.lodol.com/docs/integrations/built-in/workflows.md) reference page.
