Skip to content
Latchkey

GitHub Actions reusable workflow "Invalid input, X is not defined" in CI

A reusable workflow accepts only the inputs it declares under on.workflow_call.inputs. Passing an undeclared key under with fails the call because that input is not defined.

What this error means

The caller fails with "invalid input, X is not defined in the referenced workflow" naming the key passed under with.

GitHub Actions
Invalid workflow file: .github/workflows/caller.yml
(Line: 7, Col: 7): invalid input, 'regionn' is not defined in the referenced workflow.

Common causes

A typo in the input key under with

A misspelled key like regionn does not match any declared input, so it is rejected.

The called workflow does not declare that input

The caller passes a key the reusable workflow author never added to its inputs block.

How to fix it

Match with-keys to declared inputs

  1. List the declared inputs in the called workflow.
  2. Fix the typo, or remove the undeclared key.
  3. Re-run the caller.
.github/workflows/caller.yml
# caller
with:
  region: us-east-1
# callee declares
inputs:
  region:
    type: string

Declare the input in the reusable workflow

If the input is genuinely needed, add it to the called workflow under on.workflow_call.inputs.

How to prevent it

  • Keep caller with keys aligned with declared inputs.
  • Version reusable workflows so input changes are explicit.
  • Review the callee inputs when updating a caller.

Frequently asked questions

What causes ""Invalid input, X is not defined""?
A misspelled key like regionn does not match any declared input, so it is rejected.
How do I fix "Invalid input, X is not defined"?
Match with-keys to declared inputs

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card