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

# workflow

> Run batch workflow steps on datasets

Run an asynchronous workflow on an existing dataset. Trigger commands return a `workflow_run_id`; use [`workflow wait`](#workflow-wait) or [`workflow status`](#workflow-status) to inspect the run and continue with its `output_dataset_id`.

Every workflow creates a child dataset rather than modifying its input in place.

## Subcommands

| Command | Purpose |
| - | - |
| `onboard` | Normalize an uploaded CSV or Excel dataset. |
| `match` | Match dataset rows to Landbase company and person records. |
| `enrich` | Add company and person attributes to matched rows. |
| `contact-enrich` | Find email and phone data for dataset contacts. |
| `qualify` | Apply AI yes/no qualification prompts to rows. |
| `research` | Run structured per-row research with citations. |
| `publish` | Prepare a dataset for download as CSV, JSONL.gz, or Parquet. |
| `transform` | Create a derived dataset with DuckDB SQL. |
| `union` | Union 2–1000 datasets, optionally deduplicating rows. |
| `relaxed-join` | Join 2–6 datasets on shared columns. |
| `similar-company-expansion` | Find companies similar to rows in a dataset. |
| `crm-suppress` | Remove rows matching CRM Do-not-contact or Customers rules. |
| `crm-push` | Create dataset rows as records in the connected CRM. |
| `generate-messages` | Generate personalized email sequences for rows. |
| `instantly-push` | Create an Instantly campaign from generated messages. |
| `status` | Read one workflow-run snapshot. |
| `wait` | Poll a workflow run until it is terminal. |
| `cancel` | Request best-effort cancellation of a running workflow. |

## workflow onboard

```bash theme={null}
landbase-cli workflow onboard <dataset-id> [--wait] [--timeout=<seconds>]
```

Normalize an uploaded file into the Landbase schema. Use the returned `output_dataset_id` for matching and later workflows.

## workflow match

```bash theme={null}
landbase-cli workflow match <dataset-id> [--wait] [--timeout=<seconds>]
```

Fuzzy-match each row to Landbase company and person records. Run this before enrichment, qualification, CRM suppression, or message generation when those workflows require match identifiers.

## workflow enrich

```bash theme={null}
landbase-cli workflow enrich <dataset-id> [flags]
```

Add company and person attributes to matched rows.

| Flag | Description |
| - | - |
| `--company-fields=<fields>` | Comma-separated company fields to return. |
| `--person-fields=<fields>` | Comma-separated person fields to return. |
| `--session=<label-or-id>` | Link the workflow to a search session. |
| `--wait` | Poll until the workflow completes. |
| `--timeout=<seconds>` | Override the polling timeout. |

AI qualification and research flags are not accepted here. Run `workflow qualify` or `workflow research` as a separate step after enrichment.

## workflow contact-enrich

```bash theme={null}
landbase-cli workflow contact-enrich <dataset-id> [flags]
```

Find contact email and phone data through the dataset workflow. Rows need a LinkedIn URL or a name plus company anchor. The workflow creates an enriched child dataset and a contact-enrichment report.

| Flag | Description |
| - | - |
| `--enrich-email` / `--no-enrich-email` | Enable or disable email enrichment. Both channels run by default; positive flags switch to opt-in behavior. |
| `--enrich-phone` / `--no-enrich-phone` | Enable or disable phone enrichment. |
| `--overwrite-existing` | Replace existing contact values with this run's results. |
| `--row-slice=START:END` | Process only rows `START` through `END - 1`. |
| `--session=<label-or-id>` | Link the workflow to a search session. |
| `--wait` | Poll until the workflow completes. |
| `--timeout=<seconds>` | Override the polling timeout. |

A run may succeed with pending rows when the provider time limit is reached. Use the run status and report dataset to inspect pending or skipped rows. Publish the output before downloading it.

## workflow qualify

```bash theme={null}
landbase-cli workflow qualify <dataset-id> [flags]
```

Use AI to evaluate each row against one or more yes/no prompts. Run it on an enriched dataset.

| Flag | Description | |
| - | - | - |
| \`--qualification-prompts="Q1 | Q2"`or repeated`--prompt="Q"\` | Required qualification prompts. Do not mix spellings in one command. |
| `--context-cols=<columns>` | Columns visible to the model. Identity columns are not automatically included. | |
| `--enable-web-search` | Allow web lookup; include identity fields in `--context-cols`. | |
| `--stop-early-at-num-qualified=<n>` | Stop starting new model calls after this many rows qualify. | |
| `--row-slice=START:END` | Process a half-open row slice. | |
| `--planned-source-qual` | Use the planned source qualification mode. | |
| `--session=<label-or-id>` | Link the workflow to a search session. | |
| `--yes` | Confirm the quoted paid operation. The run is still balance-checked. | |

Qualification is quote-gated. Without `--yes`, interactive runs ask for approval and non-interactive runs return `CONFIRMATION_REQUIRED`.

## workflow research

```bash theme={null}
landbase-cli workflow research <dataset-id> --tasks-file=<path>|- [flags]
```

Run structured per-row research with citations. Each task requires a unique `research_task_name`, non-empty `context_cols`, and a `prompt`; optional fields include `enable_web_search`, `data_schema`, and `model_override`.

| Flag | Description | |
| - | - | - |
| \`--tasks-file=\<path> | -\` | JSON array of research tasks, or one task object. Use `-` for stdin. |
| `--row-slice=START:END` | Process only the half-open row slice. | |
| `--session=<label-or-id>` | Link the workflow to a search session. | |

## workflow publish

```bash theme={null}
landbase-cli workflow publish <dataset-id> [--format=csv|jsonl.gz|parquet] [--wait]
```

Prepare a dataset for download. The output is a published child dataset; use `datasets download` with that child ID.

## workflow transform

```bash theme={null}
landbase-cli workflow transform <dataset-id> [flags]
```

Run a DuckDB SQL transform. The input dataset is available as `input_dataset`.

| Flag | Description |
| - | - |
| `--sql="SELECT ..."` | Inline SQL; mutually exclusive with `--sql-file`. |
| `--sql-file=<path>` | Read SQL from a file; mutually exclusive with `--sql`. |
| `--additional-datasets="name=dataset-id"` | Expose up to five additional datasets as named SQL tables. |
| `--session=<label-or-id>` | Link the workflow to a search session. |

Exactly one SQL source is required. Use `datasets fields` and `datasets peek` to validate a single-dataset query before creating a workflow run.

## workflow union

```bash theme={null}
landbase-cli workflow union <dataset-id> <dataset-id> [<dataset-id>...] [flags]
```

Union 2–1000 datasets. Without dedupe keys, every input row is kept; use this mode to recombine disjoint row slices.

| Flag | Description | |
| - | - | - |
| \`--dedupe-keys="key1 | key2"\` | Collapse rows sharing the specified columns or scalar SQL expressions. |
| `--order-by="column DESC"` | Choose the surviving row within each dedupe group. Requires `--dedupe-keys`. | |
| `--session=<label-or-id>` | Link the workflow to a search session. | |

`union-dedupe` remains a compatibility alias, but `union` with opt-in `--dedupe-keys` is the current command.

## workflow relaxed-join

```bash theme={null}
landbase-cli workflow relaxed-join <dataset-id> <dataset-id> [<dataset-id>...] [flags]
```

Join 2–6 datasets on shared key columns. Empty and null keys never match.

| Flag | Description | | |
| - | - | - | - |
| `--join-keys=column1,column2` | Required shared column names. | | |
| \`--join-type=inner | left | outer\` | Join semantics; defaults to `left`. |
| `--session=<label-or-id>` | Link the workflow to a search session. | | |

## workflow similar-company-expansion

```bash theme={null}
landbase-cli workflow similar-company-expansion <dataset-id> [flags]
```

Find companies similar to those in the input dataset. The result includes rank, website, similarity score, and source company.

| Flag | Description |
| - | - |
| `--website-column=<column>` | Input website column; use `CLI_website` for onboarded uploads. |
| `--firmographics-guidance=<text>` | Optional guidance for firmographic profile inference. |
| `--session=<label-or-id>` | Link the workflow to a search session. |

Publish the output before downloading it.

## workflow crm-suppress

```bash theme={null}
landbase-cli workflow crm-suppress <dataset-id> --crm=<provider> [flags]
```

Remove rows matched to the connected CRM's Do-not-contact rule, and optionally its Customers rule.

| Flag | Description |
| - | - |
| `--crm=<provider>` | Required CRM provider, such as `hubspot` or `salesforce`. |
| `--org-id=<id>` | CRM portal or organization ID when the account has multiple connections. |
| `--companies` | Also remove companies matching the Customers rule. |

The CRM connection must have approved field mappings and a completed sync.

## workflow crm-push

```bash theme={null}
landbase-cli workflow crm-push <dataset-id> --yes [flags]
```

Create dataset rows as records in the connected CRM. This is insert-only and requires explicit `--yes` confirmation.

| Flag | Description |
| - | - |
| `--list-name=<name>` | Tag pushed records with a list name. |
| `--integration-id=<id>` | Select the connected CRM portal or organization. |
| `--allow-source-emails` | Allow original source email values. Requires `--email-column`. |
| `--email-column=<column>` | Source email field used with `--allow-source-emails`. |
| `--set <object>.<property>=<value>` | Set a CRM property on newly created records; repeatable. |

Run `crm-suppress` before contact enrichment and CRM push when suppression rules apply.

## workflow generate-messages

```bash theme={null}
landbase-cli workflow generate-messages <dataset-id> [flags]
```

Generate a personalized email sequence for each row. The output adds `subject_1..N`, `body_1..N`, `message_generation_status`, and error details.

| Flag | Description |
| - | - |
| `--instruction="..."` | Campaign brief; requires `--context-cols`. |
| `--context-cols=<columns>` | Columns visible to the writer. |
| `--num-messages=<n>` | Number of messages, 1–5; defaults to 3. |
| `--sender-website=<domain>` | Sender company website override. |
| `--sender-company-id=<id>` | Sender Landbase company ID override. |
| `--row-slice=START:END` | Process a half-open row slice. |
| `--session=<label-or-id>` | Link the workflow to a search session. |

## workflow instantly-push

```bash theme={null}
landbase-cli workflow instantly-push <dataset-id> --yes [flags]
```

Create an Instantly campaign from a `generate-messages` output. This command is beta and creates a draft unless `--activate` is passed.

| Flag | Description | |
| - | - | - |
| `--yes` | Required confirmation; there is no interactive fallback. | |
| `--integration-id=<id>` | Required Instantly connection ID. | |
| `--campaign-name=<name>` | Required campaign name. | |
| `--timezone=<zone>` | Required Instantly sending timezone. | |
| `--sender-emails=a,b` | Required sending accounts on the connection. | |
| \`--duplicate-policy=workspace | campaign\` | Duplicate handling; defaults to `workspace`. |
| `--activate` | Start sending on Instantly's default schedule instead of creating a draft. | |
| `--idempotency-key=<key>` | Force a new push for otherwise identical arguments. | |

Use `integrations list --provider=instantly` and `integrations senders <integration-id>` to find connection and sender IDs.

## workflow status

```bash theme={null}
landbase-cli workflow status <workflow-run-id>
```

Read one workflow-run snapshot. Terminal statuses are `SUCCEEDED`, `FAILED`, and `CANCELLED`. The preferred new form takes a run ID. The legacy dataset form remains available for compatibility.

## workflow wait

```bash theme={null}
landbase-cli workflow wait <workflow-run-id> [--quiet] [--verbose]
```

Poll until the workflow reaches a terminal state. The wait budget is 120 polls at 15 seconds; expiry stops waiting but does not cancel server-side work. Progress goes to stderr and the final JSON envelope goes to stdout.

## workflow cancel

```bash theme={null}
landbase-cli workflow cancel <workflow-run-id>
```

Request best-effort cancellation of a running workflow. Cancellation does not roll back rows already written or external CRM records.

## Compatibility notes

Trigger commands still accept `--wait` for one release. New scripts should capture `.operation.workflow_run_id` and use `workflow wait`. Use `datasets lineage` when a workflow has multiple outputs or the output dataset ID is not present in the immediate response.


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