> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowra.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a workflow

> List workflows, execute one via the API or SDK, and poll the thread or execution status.

**Goal:** Start a workflow from your backend and confirm it finished.

## Prerequisites

* API key for your project — [Authentication](/authentication)
* A workflow id from the dashboard or list workflows
* Optional: [TypeScript](/guides/sdk-typescript) or [Python](/guides/sdk-python) SDK

## Steps

<Steps>
  <Step title="List workflows">
    <CodeGroup>
      ```bash theme={null}
      curl -X GET "https://flowra.dev/api/v1/workflow/manager/list?limit=10" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```ts theme={null}
      import { Flowra } from '@flowra/sdk';

      const flowra = new Flowra({ apiKey: process.env.FLOWRA_API_KEY! });
      const list = await flowra.workflows.list({ limit: 10 });
      ```

      ```python theme={null}
      from flowra import Flowra

      flowra = Flowra(api_key="YOUR_API_KEY")
      list = flowra.workflows.list(limit=10)
      ```
    </CodeGroup>

    Copy the id of the workflow you want to run. For agents vs static behavior, see [Workflows and agents](/guides/workflows-and-agents).
  </Step>

  <Step title="Execute">
    <CodeGroup>
      ```bash theme={null}
      curl -X POST "https://flowra.dev/api/v1/workflow/manager/execute/WORKFLOW_ID" \
        -H "x-api-key: YOUR_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{ "input": { "message": "Run a short smoke test" } }'
      ```

      ```ts theme={null}
      const run = await flowra.workflows.run(workflowId, {
        input: { message: 'Run a short smoke test' },
      });
      // Save run.threadId
      ```

      ```python theme={null}
      run = flowra.workflows.run(
          "WORKFLOW_ID",
          {"input": {"message": "Run a short smoke test"}},
      )
      # Save run["threadId"]
      ```
    </CodeGroup>

    Save the returned **thread ID**.
  </Step>

  <Step title="Inspect the run">
    <CodeGroup>
      ```bash theme={null}
      curl -X GET "https://flowra.dev/api/v1/workflow/manager/executions/thread/THREAD_ID/status" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```ts theme={null}
      const status = await flowra.workflows.status(threadId);
      ```

      ```python theme={null}
      status = flowra.workflows.status(thread_id)
      ```
    </CodeGroup>

    Use executions endpoints from [Workflows](/guides/workflows) or poll thread state via [Threads](/guides/threads). If the run pauses for approval, see [Human in the loop](/guides/human-in-the-loop).
  </Step>
</Steps>

## Verify

* Execute returns a thread id without an auth error
* Execution status reaches a terminal success (or a clear pause you can resume)

## Next

* [Connect an account](/recipes/connect-an-account)
* [Multi-tenant basics](/recipes/multi-tenant-basics)
* [API reference](/api-reference)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.