crewAIInc/crewAI · error · Exception

No trigger payload provided. Please provide JSON payload as

Error message

No trigger payload provided. Please provide JSON payload as argument.

What it means

Raised by run_with_trigger() in the flow template (templates/flow/main.py) when the script is started without a CLI argument. It is a usage guard mirroring the crew template: flow trigger execution requires a JSON payload as argv[1], forwarded to content_flow.kickoff({'crewai_trigger_payload': ...}).

Source

Thrown at lib/cli/src/crewai_cli/templates/flow/main.py:72

def kickoff():
    content_flow = ContentFlow()
    content_flow.kickoff()


def plot():
    content_flow = ContentFlow()
    content_flow.plot()


def run_with_trigger():
    """
    Run the flow with trigger payload.
    """
    import json
    import sys

    if len(sys.argv) < 2:
        raise Exception("No trigger payload provided. Please provide JSON payload as argument.")

    try:
        trigger_payload = json.loads(sys.argv[1])
    except json.JSONDecodeError:
        raise Exception("Invalid JSON payload provided as argument")

    content_flow = ContentFlow()

    try:
        result = content_flow.kickoff({"crewai_trigger_payload": trigger_payload})
        return result
    except Exception as e:
        raise Exception(f"An error occurred while running the flow with trigger: {e}")


if __name__ == "__main__":
    kickoff()

View on GitHub (pinned to 754d7323be)

Solutions

  1. Pass the JSON payload as the first argument: `uv run run_with_trigger '{"key": "value"}'`.
  2. Verify the trigger configuration on the platform actually forwards the payload into the process argv.
  3. Shell-quote the JSON so braces and quotes survive to argv.
Defensive patterns

Strategy: validation

Validate before calling

import sys
if len(sys.argv) < 2 or not sys.argv[1].strip():
    raise SystemExit("No trigger payload provided. Pass a JSON payload as argv[1].")

Type guard

def has_payload_arg(argv: list[str]) -> bool:
    return len(argv) >= 2 and bool(argv[1].strip())

Prevention

When it happens

Trigger: Invoking the flow's run_with_trigger entrypoint with no arguments (len(sys.argv) < 2): local run without payload, or an automation/trigger runner that fails to pass the payload through to the process.

Common situations: Flow deployed to an automation platform whose trigger is not wired to forward the body; testing `python main.py` directly expecting the plain kickoff path; wrapper scripts dropping arguments.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/b6d89c6c4f0b47e7. Report an issue: GitHub.