{"record":{"id":"10c4cb05db1a833d","repo":"crewAIInc/crewAI","slug":"no-trigger-payload-provided-please-provide-json-p","errorCode":null,"errorMessage":"No trigger payload provided. Please provide JSON payload as argument.","messagePattern":"No trigger payload provided\\. Please provide JSON payload as argument\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/templates/crew/main.py","lineNumber":73,"sourceCode":"    inputs = {\n        \"topic\": \"AI LLMs\",\n        \"current_year\": str(datetime.now().year)\n    }\n\n    try:\n        {{crew_name}}().crew().test(n_iterations=int(sys.argv[1]), eval_llm=sys.argv[2], inputs=inputs)\n\n    except Exception as e:\n        raise Exception(f\"An error occurred while testing the crew: {e}\")\n\ndef run_with_trigger():\n    \"\"\"\n    Run the crew with trigger payload.\n    \"\"\"\n    import json\n\n    if len(sys.argv) < 2:\n        raise Exception(\"No trigger payload provided. Please provide JSON payload as argument.\")\n\n    try:\n        trigger_payload = json.loads(sys.argv[1])\n    except json.JSONDecodeError:\n        raise Exception(\"Invalid JSON payload provided as argument\")\n\n    inputs = {\n        \"crewai_trigger_payload\": trigger_payload,\n        \"topic\": \"\",\n        \"current_year\": \"\"\n    }\n\n    try:\n        result = {{crew_name}}().crew().kickoff(inputs=inputs)\n        return result\n    except Exception as e:\n        raise Exception(f\"An error occurred while running the crew with trigger: {e}\")\n","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/templates/crew/main.py#L55-L91","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass a JSON payload as the first argument: `uv run run_with_trigger '{\"key\": \"value\"}'`.","If invoked by an automation platform, check the platform's trigger configuration actually delivers the payload to the process argv.","Quote the JSON properly in shells — unquoted braces can be consumed by the shell, leaving argv empty."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import sys\nif len(sys.argv) < 2 or not sys.argv[1].strip():\n    raise SystemExit(\"No trigger payload provided. Pass a JSON payload as argv[1].\")","typeGuard":"def has_payload_arg(argv: list[str]) -> bool:\n    return len(argv) >= 2 and bool(argv[1].strip())","tryCatchPattern":null,"preventionTips":["Always quote and pass the JSON payload as the first CLI argument","In automation runners, assert the payload is non-empty before invoking the script"],"tags":["crewai","cli","template","triggers","usage"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}