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 crew template when the script is invoked without a command-line argument. It is a deliberate usage guard: trigger execution requires a JSON payload as argv[1] which is passed into kickoff as the 'crewai_trigger_payload' input.

Source

Thrown at lib/cli/src/crewai_cli/templates/crew/main.py:73

    inputs = {
        "topic": "AI LLMs",
        "current_year": str(datetime.now().year)
    }

    try:
        {{crew_name}}().crew().test(n_iterations=int(sys.argv[1]), eval_llm=sys.argv[2], inputs=inputs)

    except Exception as e:
        raise Exception(f"An error occurred while testing the crew: {e}")

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

    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")

    inputs = {
        "crewai_trigger_payload": trigger_payload,
        "topic": "",
        "current_year": ""
    }

    try:
        result = {{crew_name}}().crew().kickoff(inputs=inputs)
        return result
    except Exception as e:
        raise Exception(f"An error occurred while running the crew with trigger: {e}")

View on GitHub (pinned to 754d7323be)

Solutions

  1. Pass a JSON payload as the first argument: `uv run run_with_trigger '{"key": "value"}'`.
  2. If invoked by an automation platform, check the platform's trigger configuration actually delivers the payload to the process argv.
  3. Quote the JSON properly in shells — unquoted braces can be consumed by the shell, leaving argv empty.
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: Executing the generated main.py's run_with_trigger entrypoint with zero CLI arguments (len(sys.argv) < 2), e.g. `uv run run_with_trigger` or `python main.py` in a template wired to triggers, or when the invoking process (CI/webhook runner) passes no payload.

Common situations: Crew deployed to CrewAI Plus / automation platform where the trigger payload was not forwarded; local testing where the developer forgets to echo a JSON blob; a wrapper script swallowing arguments.

Related errors


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