{"record":{"id":"c777d6458024cdfb","repo":"ATH-MaaS/Pixelle-Video","slug":"api-workflow-workflow-not-found-available-api","errorCode":null,"errorMessage":"API workflow '{workflow}' not found. Available API workflows: {available}","messagePattern":"API workflow '(.+?)' not found\\. Available API workflows: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_media.py","lineNumber":424,"sourceCode":"            \"key\": key,\n        }\n        if media_type == \"video\":\n            capabilities = self._video_capabilities(provider, model)\n            info[\"capabilities\"] = capabilities\n            info[\"ability_type\"] = capabilities.get(\"ability_type\")\n            info[\"ability_types\"] = capabilities.get(\"ability_types\", [])\n            info[\"adapter_ability_types\"] = capabilities.get(\"adapter_ability_types\", [])\n            info[\"api_contract_verified\"] = capabilities.get(\"api_contract_verified\", False)\n            info[\"contract_issues\"] = capabilities.get(\"contract_issues\", [])\n        return info\n\n    def resolve_workflow(self, workflow: str) -> dict:\n        \"\"\"Resolve an api/provider/model key to model metadata.\"\"\"\n        for info in self.list_workflows():\n            if info[\"key\"] == workflow:\n                return info\n        available = \", \".join(info[\"key\"] for info in self.list_workflows())\n        raise ValueError(f\"API workflow '{workflow}' not found. Available API workflows: {available}\")\n\n    async def __call__(\n        self,\n        prompt: str,\n        workflow: str,\n        media_type: str = \"image\",\n        width: Optional[int] = None,\n        height: Optional[int] = None,\n        duration: Optional[float] = None,\n        output_path: Optional[str] = None,\n        image_path: Optional[str] = None,\n        **params,\n    ) -> MediaResult:\n        info = self.resolve_workflow(workflow)\n        provider = info[\"provider\"]\n        model = info[\"model\"]\n        resolved_media_type = info.get(\"media_type\") or media_type\n","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_media.py#L406-L442","documentation":"resolve_workflow looks up the workflow key among list_workflows() results and raises ValueError when no entry matches, listing all valid 'api/provider/model' keys.","triggerScenarios":"Calling __call__ (or resolve_workflow directly) with workflow='<provider>/<model>' string that isn't in the current workflow list — typo, model removed/renamed upstream, or model not enabled for the account.","commonSituations":"Provider renamed or deprecated a model; account lacks access so the model isn't enumerated; hard-coded workflow string from an older config; separator mismatch ('/' vs ':').","solutions":["Print service.list_workflows() and copy the exact 'key' of the desired workflow","Use one of the keys listed in the error message","Refresh the workflow/model list (models may have been renamed upstream) and update your config","Verify your account actually has access to the model so it appears in list_workflows()"],"exampleFix":"# before\nawait api_media(prompt=\"sunset\", workflow=\"dashscope/wan2.5-t2v\")\n# after\nawait api_media(prompt=\"sunset\", workflow=\"dashscope/wan2.7-t2v\")  # key from list_workflows()","handlingStrategy":"validation","validationCode":"keys = {info[\"key\"] for info in service.list_workflows()}\nif workflow not in keys:\n    raise ValueError(f\"unknown workflow {workflow!r}; pick one of {sorted(keys)}\")","typeGuard":"def valid_workflow(service, workflow: str) -> bool:\n    return any(i[\"key\"] == workflow for i in service.list_workflows())","tryCatchPattern":"try:\n    meta = service.resolve_workflow(workflow)\nexcept ValueError as e:\n    logger.warning(\"workflow not found, refreshing list: %s\", e)\n    meta = service.resolve_workflow(pick_closest_workflow(service.list_workflows(), workflow))","preventionTips":["Resolve workflow keys from list_workflows() at runtime rather than hardcoding","Refresh the workflow list periodically — models get renamed/deprecated upstream","Verify account access so intended models appear in the enumeration"],"tags":["validation","invalid-value","workflow"],"backgroundTag":"invalid-enum-value","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}