{"record":{"id":"b6d89c6c4f0b47e7","repo":"crewAIInc/crewAI","slug":"no-trigger-payload-provided-please-provide-json-p-b6d89c","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/flow/main.py","lineNumber":72,"sourceCode":"def kickoff():\n    content_flow = ContentFlow()\n    content_flow.kickoff()\n\n\ndef plot():\n    content_flow = ContentFlow()\n    content_flow.plot()\n\n\ndef run_with_trigger():\n    \"\"\"\n    Run the flow with trigger payload.\n    \"\"\"\n    import json\n    import sys\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    content_flow = ContentFlow()\n\n    try:\n        result = content_flow.kickoff({\"crewai_trigger_payload\": trigger_payload})\n        return result\n    except Exception as e:\n        raise Exception(f\"An error occurred while running the flow with trigger: {e}\")\n\n\nif __name__ == \"__main__\":\n    kickoff()\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/templates/flow/main.py#L54-L90","documentation":"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': ...}).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass the JSON payload as the first argument: `uv run run_with_trigger '{\"key\": \"value\"}'`.","Verify the trigger configuration on the platform actually forwards the payload into the process argv.","Shell-quote the JSON so braces and quotes survive to argv."],"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 pass the JSON payload as argv[1] when invoking run_with_trigger","Verify the automation platform forwards the trigger body to the process"],"tags":["crewai","flow","cli","template","triggers","usage"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}