# Select a Test Suite with Trigger Inputs (https://www.shipfox.io/docs/how-to/author-workflows/pass-trigger-inputs)

Description: Use one job for a quick manual check and a full scheduled test run.

Use fixed trigger inputs when several start paths should run the same job with
different settings. This guide maps a manual trigger to smoke tests and a Cron
trigger to the full test suite.

## Before you begin [#before-you-begin]

You need:

* A Node.js repository with `test:smoke` and `test` scripts.

## Add the workflow [#add-the-workflow]

Create `.shipfox/workflows/test-suites.yml`. This is a complete workflow:

```yaml
# yaml-language-server: $schema=https://www.shipfox.io/docs/workflow.schema.json
name: Run the right test suite
runner: shipfox

triggers:
  manual_smoke:
    source: manual
    with:
      suite: smoke

  nightly_full:
    source: cron
    config:
      schedule: "0 2 * * *"
      timezone: UTC
    with:
      suite: full

jobs:
  test:
    steps:
      - run: npm ci
      - env:
          TEST_SUITE: "${{ inputs.suite }}"
        run: |
          case "$TEST_SUITE" in
            smoke) npm run test:smoke ;;
            full) npm test ;;
            *) printf 'Unknown test suite: %s\n' "$TEST_SUITE" >&2; exit 2 ;;
          esac
```

Each trigger records its `with` values as run `inputs`. The run step gives the
selected suite a shell variable because the `case` statement uses that value
across several branches. The allowlist rejects any suite the workflow does not
support.

Commit and push the file to the project's default branch. Wait for **Run the
right test suite** to sync.

## Verify both start paths [#verify-both-start-paths]

For a quick schedule check, temporarily set `schedule` to the next UTC minute.
Restore `0 2 * * *` after both start paths work.

1. Select **Run**. Open the run and check that it uses `smoke` and calls
   `npm run test:smoke`.
2. After the next scheduled run, check that it uses `full` and calls `npm test`.
3. Open each run's trigger data. Confirm that the matching `with` value appears
   under `inputs`.

The [Contexts reference](https://www.shipfox.io/docs/reference/contexts#context-availability) defines
where `inputs` is available. [Schedule workflows](https://www.shipfox.io/docs/how-to/author-workflows/schedule-workflows)
defines Cron schedule fields.