{"record":{"id":"e3db634f1e95347b","repo":"ATH-MaaS/Pixelle-Video","slug":"workflow-workflow-not-found-available-workflo","errorCode":null,"errorMessage":"Workflow '{workflow}' not found. Available workflows: {available_str}","messagePattern":"Workflow '(.+?)' not found\\. Available workflows: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/comfy_base_service.py","lineNumber":231,"sourceCode":"            ValueError: If workflow not found\n        \"\"\"\n        # 1. If not specified, use default from config\n        if workflow is None:\n            workflow = self._get_default_workflow()\n        \n        # 2. Scan available workflows\n        available_workflows = self._scan_workflows()\n        \n        # 3. Find matching workflow by key\n        for wf_info in available_workflows:\n            if wf_info[\"key\"] == workflow:\n                logger.info(f\"🎬 Using {self.service_name} workflow: {workflow}\")\n                return wf_info\n        \n        # 4. Not found - generate error message\n        available_keys = [wf[\"key\"] for wf in available_workflows]\n        available_str = \", \".join(available_keys) if available_keys else \"none\"\n        raise ValueError(\n            f\"Workflow '{workflow}' not found. \"\n            f\"Available workflows: {available_str}\"\n        )\n    \n    def _prepare_comfykit_config(\n        self,\n        comfyui_url: Optional[str] = None,\n        runninghub_api_key: Optional[str] = None,\n        runninghub_instance_type: Optional[str] = None,\n    ) -> Dict[str, Any]:\n        \"\"\"\n        Prepare ComfyKit configuration\n        \n        Args:\n            comfyui_url: ComfyUI URL (optional, overrides config)\n            runninghub_api_key: RunningHub API key (optional, overrides config)\n            runninghub_instance_type: RunningHub instance type (optional, overrides config)\n        ","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/comfy_base_service.py#L213-L249","documentation":"_resolve_workflow() looks up the requested workflow key among workflows discovered by _scan_workflows() (keys formatted as '<source>/<filename>', e.g. 'runninghub/image_flux.json'). If the requested key doesn't match any discovered workflow, it raises ValueError listing all available keys (or 'none' if the scan found nothing). This validates user-supplied workflow names against the filesystem/workflow registry.","triggerScenarios":"Passing a workflow argument to the service call (via __call__ -> _resolve_workflow) that doesn't exactly match a scanned key: wrong filename, missing the '<source>/' prefix, wrong case, or the workflow file being absent from the scanned directory. Also occurs when the scan directory is empty/misconfigured, producing 'Available workflows: none'.","commonSituations":"Typo in the workflow filename; forgetting the source prefix ('image_flux.json' instead of 'runninghub/image_flux.json'); workflow file deleted or never added to the workflows directory; workflows directory path misconfigured so the scan returns nothing; case-sensitive filesystem mismatches.","solutions":["Use one of the exact keys listed in the error message's 'Available workflows' list.","Include the full '<source>/<filename>' form (e.g. 'runninghub/image_flux.json'), not just the filename.","Confirm the workflow JSON file exists in the directory scanned by _scan_workflows and has the exact name/case used in the key.","If the list says 'none', fix the workflows directory configuration so the scan can find any workflows."],"exampleFix":"# before\nservice(workflow='image_flux.json')\nValueError: Workflow 'image_flux.json' not found. Available workflows: runninghub/image_flux.json\n# after\nservice(workflow='runninghub/image_flux.json')  # exact key from the available list","handlingStrategy":"validation","validationCode":"available = {wf[\"key\"] for wf in service._scan_workflows()}\nif workflow not in available:\n    raise SystemExit(f\"Unknown workflow '{workflow}'. Available: {sorted(available)}\")","typeGuard":"def workflow_exists(service, workflow: str) -> bool:\n    return any(wf[\"key\"] == workflow for wf in service._scan_workflows())","tryCatchPattern":"try:\n    result = service(prompt, workflow=workflow)\nexcept ValueError as e:\n    if \"not found. Available workflows:\" in str(e):\n        logger.error(str(e))  # lists valid keys to choose from\n        result = service(prompt)  # fall back to configured default","preventionTips":["Copy workflow keys verbatim from the 'Available workflows' list, including the '<source>/' prefix.","Keep workflow JSON files in the directory that _scan_workflows scans, with exact names/case.","Centralize workflow keys as constants instead of hand-typing strings at call sites.","If the error says 'Available workflows: none', fix the workflows directory configuration first."],"tags":["python","valueerror","workflow","comfyui","invalid-argument"],"backgroundTag":"resource-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}