Skip to content
Latchkey

GitHub Actions "input ... is not defined in the referenced workflow" in CI

A caller may only pass inputs that the reusable workflow declares under on.workflow_call.inputs. Passing an undeclared key in with: is rejected as an invalid input.

What this error means

The caller fails with "invalid input, X is not defined in the referenced workflow" or "Unexpected input(s) X". The with: key does not match any declared input name.

GitHub Actions
Invalid workflow file: .github/workflows/ci.yml#L10
invalid value workflow reference: input "enviroment" is not defined
in the referenced workflow "./.github/workflows/deploy.yml".

Common causes

A typo in the input name

The caller passes enviroment but the workflow declares environment. Input names must match exactly.

The input was never declared in the callee

You added a with: key in the caller without adding the matching entry under the called workflow's workflow_call.inputs.

How to fix it

Declare the input in the reusable workflow

  1. Open the called workflow and add the input under workflow_call.inputs.
  2. Give it a type (string, boolean, or number) and required flag.
  3. Match the caller with: key to the declared name exactly.
.github/workflows/deploy.yml
on:
  workflow_call:
    inputs:
      environment:
        required: true
        type: string

Fix the caller with: key

Correct the spelling so the passed key matches a declared input.

.github/workflows/ci.yml
with:
  environment: production

How to prevent it

  • Keep caller with: keys and callee input names in sync.
  • Declare every input the caller passes under workflow_call.inputs.
  • Review the reusable workflow inputs list when adding a new with: key.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →