# geni workflow preview-filter

> Test a published or local filter without running the workflow body.

Source: https://docs.generalinput.com/cli/resource/workflow/preview-filter



```sh
geni workflow preview-filter [id] --payload '{"total":500}' --trigger incoming-order
geni workflow preview-filter [id] --draft --dir ./my-workflow --payload '{}'
```

Runs `filter.ts` once and returns its `skip` or `run` decision, reason, transformed input, trigger identity and logs. The published filter is used by default; `--draft` uploads the local directory and previews it before publishing. Credentials and consts come from the saved workflow's config.

Published previews require run access. Draft previews require edit access.

This uses live credentials, databases and stores. Dedup state written by the filter persists, so the second preview can return a different decision. The workflow body does not run.

| Flag               | Purpose                                                                                |
| ------------------ | -------------------------------------------------------------------------------------- |
| `--payload <json>` | Event JSON object; defaults to `{}`.                                                   |
| `--trigger <key>`  | Trigger node id from `workflow.json`. Select it for a workflow with multiple triggers. |
| `--draft`          | Preview local files rather than the published filter.                                  |
| `--dir <path>`     | Directory for id resolution and local files. Defaults to cwd.                          |
| `--json`           | Machine-readable output.                                                               |

A preview that cannot reach a decision exits with code `9`. After a `run` decision, pass its returned `input` to [`geni workflow test`](/cli/resource/workflow/test); if `input` is omitted, use the original payload. Manual tests exercise the body and bypass the filter.
