# Automating sessions

Turn a local session into a workflow that runs in the cloud, anywhere and anytime: on demand, on a schedule, from a webhook, or from a hosted form. Your laptop can stay closed. If you have not run fl0w in the cloud yet, start with the [Quickstart](/docs/quickstart) and [How it works](/docs/how-it-works).

## Using the /generate slash command

1. Complete a session that demonstrates the task end-to-end.
2. Run [`/generate`](/docs/slash-commands) in the TUI and pick the session to turn into a workflow.
3. Describe the workflow inputs if needed (what varies between workflow runs)

<Image src="/docs/generating-workflows.png" width={2182} height={1602}
  alt="Generating a workflow from a session with /generate"
  sizes="(max-width: 800px) 100vw, 640px"
  className="mt-4 h-auto w-full max-w-2xl rounded-lg border border-line/80" />

## Running workflows

### Running directly

Type [`/workflow`](/docs/slash-commands) in the TUI or in **Cloud Computer** and pick a workflow to run it with optional extra instructions. From CI or cron infrastructure, use [`fl0w workflow`](/docs/cli#fl0w-workflow) instead.

### Running on a schedule

Configure a schedule trigger on the workflow: hourly, daily at a set time, weekly, or monthly. You enter times in your own timezone, and fl0w stores them as UTC. Runs before the schedule's start date are skipped. Vercel Cron calls `GET /api/cron/workflows` hourly, and matching schedules enqueue runs per user.

Set `CRON_SECRET` in the deployment environment so only your platform can hit the cron route.

<Image src="/docs/cron-trigger.png" width={1984} height={1698}
  alt="Schedule (cron) trigger configuration for a workflow"
  sizes="(max-width: 800px) 100vw, 640px"
  className="mt-4 h-auto w-full max-w-2xl rounded-lg border border-line/80" />

### Running via webhook

Every workflow gets its own endpoint, so CI, Stripe, or anything that can send a POST can start it. `POST /api/hooks/workflows/{id}` starts a run. Send JSON `{ "input": "..." }` or any body to pass through as input. When configured, authenticate with `Authorization: Bearer <secret>` or `X-Webhook-Secret`.

### Running via form

Enable a form trigger to host a page at `/forms/{workflowId}`. Share the link, and anyone can submit a request; the answers become the agent's instructions. Submissions post to `/api/forms/workflows/{id}` and stream progress at `/forms/{id}/runs/{runId}`.

## Workflow Run History

You can inspect each run's steps, logs, and outcomes in the **Automate** tab on your cloud computer — the same place shown in the [Quickstart](/docs/quickstart#running-workflows-in-the-cloud). For performance and cost tuning across workflows, see [Optimize performance and cost](/docs/quickstart#optimize-performance-and-cost) in the Quickstart.
