{"record":{"id":"f7b514b74c3bc2db","repo":"OpenBMB/ChatDev","slug":"1","errorCode":null,"errorMessage":"1","messagePattern":"1","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"check/check_workflow.py","lineNumber":148,"sourceCode":"\ndef main():\n    parser = argparse.ArgumentParser(\n        description=\"Check workflow structure: unique natural start/end or explicit start/end per (sub)graph\")\n    parser.add_argument(\"path\", nargs=\"?\", default=\"design_0.4.0.yaml\", help=\"Path to YAML file\")\n    parser.add_argument(\"--no-schema\", action=\"store_true\", help=\"Skip schema validation (0.4.0)\")\n    parser.add_argument(\"--fn-module\", dest=\"fn_module\", default=None,\n                        help=\"Module name or .py path where edge functions are defined (for schema validation)\")\n    args = parser.parse_args()\n\n    data = read_yaml(args.path)\n\n    if not args.no_schema:\n        schema_errors = check_yaml.validate_design(data, set_defaults=True, fn_module_ref=args.fn_module)\n        if schema_errors:\n            print(\"Invalid schema:\")\n            for e in schema_errors:\n                print(f\"- {e}\")\n            raise SystemExit(1)\n\n    logic_errors = check_workflow_structure(data)\n    if logic_errors:\n        print(\"Workflow issues:\")\n        for e in logic_errors:\n            print(f\"- {e}\")\n        raise SystemExit(2)\n    else:\n        print(\"Workflow OK.\")\n\n\nif __name__ == \"__main__\":\n    main()\n","sourceCodeStart":130,"sourceCodeEnd":162,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/check/check_workflow.py#L130-L162","documentation":"409 Conflict raised from the shared workflow-persist helper when uploading workflow content whose YAML file already exists on disk and allow_overwrite is false (the upload path). The update API exists specifically for overwriting.","triggerScenarios":"POST /api/workflows upload with a filename that already exists in YAML_DIR without overwrite semantics; replaying an upload request in CI or scripts.","commonSituations":"Re-deploying the same workflow; iterating locally and re-uploading instead of updating; automated pipelines that don't distinguish create vs update.","solutions":["Use the update API endpoint to overwrite the existing workflow.","Or upload under a new filename.","Delete the existing workflow first if you truly want a fresh create."],"exampleFix":"# before\nPOST /api/workflows/content  {\"filename\": \"flow.yaml\", \"content\": ...}\n# after\nPUT /api/workflows/content  {\"filename\": \"flow.yaml\", \"content\": ...}  # update API allows overwrite","handlingStrategy":"try-catch","validationCode":"// check workflow existence via list endpoint before upload","typeGuard":null,"tryCatchPattern":"catch (e) { if (e.status === 409) switchToUpdateApi(filename, content); }","preventionTips":["Use update for existing workflows, upload only for new","Make CI scripts handle 409 by falling back to update"],"tags":["workflow","conflict","yaml","fastapi"],"backgroundTag":"resource-already-exists","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}