{"record":{"id":"1ffd51280984863b","repo":"windmill-labs/windmill","slug":"path-must-be-provided","errorCode":null,"errorMessage":"path must be provided","messagePattern":"path must be provided","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"typescript-client/client.ts","lineNumber":555,"sourceCode":"    params[\"tag\"] = tag;\n  }\n\n  if (!doNotTrackInParent) {\n    let parentJobId = getEnv(\"WM_JOB_ID\");\n    if (parentJobId !== undefined) {\n      params[\"parent_job\"] = parentJobId;\n    }\n    let rootJobId = getEnv(\"WM_ROOT_FLOW_JOB_ID\");\n    if (rootJobId != undefined && rootJobId != \"\") {\n      params[\"root_job\"] = rootJobId;\n    }\n  }\n\n  let endpoint: string;\n  if (path) {\n    endpoint = `/w/${getWorkspace()}/jobs/run/f/${path}`;\n  } else {\n    throw new Error(\"path must be provided\");\n  }\n  let url = new URL(OpenAPI.BASE + endpoint);\n  url.search = new URLSearchParams(params).toString();\n\n  return fetch(url, {\n    method: \"POST\",\n    headers: {\n      \"Content-Type\": \"application/json\",\n      Authorization: `Bearer ${OpenAPI.TOKEN}`,\n    },\n    body: JSON.stringify(args),\n  }).then((res) => res.text());\n}\n\n/**\n * Resolve a resource value in case the default value was picked because the input payload was undefined\n * @param obj resource value or path of the resource under the format `$res:path`\n * @returns resource value","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/typescript-client/client.ts#L537-L573","documentation":"Thrown by runFlowAsync when the flow path argument is empty. Flows can only be launched by path (/jobs/run/f/<path>) — unlike scripts there is no hash variant — so a missing path leaves no endpoint to call and the guard fires before building the request.","triggerScenarios":"Calling runFlowAsync with path undefined, null, or an empty string.","commonSituations":"Flow path read from config/env that was not set; typos in variable names leaving path undefined.","solutions":["Supply the flow path argument","Validate the path is a non-empty string before calling","Resolve the path from config/env with an explicit check"],"exampleFix":"// before\nawait client.runFlowAsync(flowPath, args)\n// after\nif (!flowPath) throw new Error('flowPath is required')\nawait client.runFlowAsync(flowPath, args)","handlingStrategy":"validation","validationCode":"if (!path || typeof path !== 'string') throw new Error('runFlowAsync requires a non-empty flow path')","typeGuard":"function hasFlowPath(p?: string | null): p is string {\n  return typeof p === 'string' && p.length > 0\n}","tryCatchPattern":"try {\n  await client.runFlowAsync(path, args)\n} catch (e) {\n  if (e.message === 'path must be provided') console.error('Flow path missing from configuration')\n  else throw e\n}","preventionTips":["Store flow paths in validated config and check them at startup","Never rely on possibly-undefined variables for the path argument"],"tags":["typescript","api-client","flow","arguments"],"backgroundTag":"missing-required-argument","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}