> ## 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.

# Workflows vs. direct commands

> Understand when to use landbase-cli workflow commands vs. direct commands like enrich and match, and what workflows add to the picture.

# Workflows vs. direct commands

landbase-cli has two ways to process data: **direct commands** and **workflow commands**. They serve different purposes and are not interchangeable.

***

## Direct commands

Direct commands (`enrich`, `match`, `contact-enrich`) operate on **one record or a small batch** and return results immediately or after a short async wait.

```bash theme={null}
# Direct match — one record
landbase-cli match person --first-name=Sarah --last-name=Chen --company-website=acme.com

# Direct enrich — one record
landbase-cli enrich --linkedin-url=https://www.linkedin.com/in/sarahchen

# Direct contact-enrich — small batch
landbase-cli contact-enrich submit ./leads.jsonl --wait
```

Use direct commands when:

* You have one record or a handful of records
* You need results right now (synchronous or short async)
* You do not need the results saved as a dataset in your Landbase workspace
* You are piping output to another command

***

## Workflow commands

Workflow commands (`workflow match`, `workflow enrich`, `workflow publish`, etc.) operate on an **existing Landbase dataset** — a file you have already uploaded, or a dataset created by a previous search or workflow.

```bash theme={null}
# Workflow match — entire dataset
landbase-cli workflow match <dataset-id> --wait

# Workflow enrich — entire dataset
landbase-cli workflow enrich <dataset-id> --company-fields=industry,size_range --wait
```

Use workflow commands when:

* You have a dataset of many records (hundreds or thousands of rows)
* You want the results saved back into your Landbase workspace
* You want dataset lineage — a traceable chain of input → processed → output
* You need to run multiple processing steps in sequence (onboard → match → enrich → publish)

***

## The key difference: dataset lineage

Workflow commands produce **child datasets**. Every time you run a workflow on a dataset, Landbase creates a new dataset linked to the original. This lets you:

* Trace the provenance of any dataset (what was it created from?)
* Re-run a step without re-uploading
* Download any intermediate result

```bash theme={null}
# See the lineage of a dataset
landbase-cli datasets lineage <dataset-id>
```

Direct commands do not create datasets. Their output is returned to your terminal (stdout) and is not stored in your workspace.

***

## Side by side

|          | Direct commands                 | Workflow commands              |
| -------- | ------------------------------- | ------------------------------ |
| Input    | One record or small batch       | Existing dataset (by ID)       |
| Output   | JSON to stdout                  | New child dataset in workspace |
| Async    | No (enrich/match) or short wait | Yes, can take minutes          |
| Lineage  | No                              | Yes                            |
| Best for | One-off lookups, piping         | Bulk processing, pipelines     |

***

## When to use which

**Use direct commands** for ad hoc lookups during research, or when piping output to another command.

**Use workflow commands** when you have uploaded data and want to process it in Landbase, track the results, and download them in a structured format.

Many pipelines combine both: a direct `match` to verify a single candidate, then `workflow enrich` to enrich a full uploaded dataset.

***

## Related

* [How to chain workflows](/docs/how-to/chain-workflows)
* [workflow reference](/docs/reference/workflow)
* [How enrichment works](/docs/explanation/how-enrichment-works)
