Api-workflow
Part of Uipath maestro flow. Install the skill and your agent reads this page when it needs the depth.
API Workflow
Exact signatures, fields, and defaults: apiWorkflow().
Run a coded API workflow, deployed or a sibling in the same solution, as a serverless Orchestrator job.
Signature: apiWorkflow({ key?, name, folderPath, inputs?, inputSchema?, returns? }), or
apiWorkflow({ key, name, location: 'in-solution', projectId, inputs?, inputSchema?, returns? })
for an API workflow in the same solution (see In the same solution).
For a published process, leave key and returns out: check prints the registry prepare --kind Process command that records them, and compile fills both in (Orchestrator Processes). An in-solution sibling still takes key.
Orchestrator often leaves an API workflow's contract blank, so prepare prints Outputs (not recorded …); then keep returns, as below.
.step('age', apiWorkflow({ name: 'NameToAge', folderPath: 'Shared',
inputs: { name: input('name') }, returns: { age: 'integer' } }))
At a glance
Run a coded API workflow and wait for its job result.
Published workflow: confirm identity and exact argument casing on the tenant.
In-solution sibling: read them from the sibling project
(In the same solution). .onError(...) is supported.
Recording the key and contract: or-processes.md
Tenant contract
For a published workflow, the key, name, and folder must describe one deployed
resource. Confirm its actual input/output names and casing from the tenant. See
Orchestrator Processes and use the Api process type for the
shared, pagination-safe resource-discovery procedure.
.onError(...) is supported on API workflow steps. Choose a handler only when
the scenario wants recovery; otherwise a faulted job may need to fault the Flow.
To type an argument differently from its value (for example an object filled
from an expression), add inputSchema; keep one a decompiled step carries. See
Orchestrator Processes.
In the same solution
An API workflow that is a sibling project of the Flow, in the same solution, is
not published yet, so it has no folder. Write it with location: 'in-solution'
and projectId instead of folderPath:
.step('notify', apiWorkflow({
key: localResourceKey,
name: '<ApiWorkflowProject>',
location: 'in-solution',
projectId: localProjectKey,
inputs: { name: input('name') },
}))
- Or name the sibling by project (
@uipath/maestro-builder-sdk6.108.0 or later):apiWorkflow({ location: 'in-solution', project: '<ApiWorkflowProject>', inputs, returns }). See agent.md for what it fills in, what it refuses, and when to fall back to the ids below. - Where the two ids come from. Same recipe as an in-solution function
(published-function.md), with
process/api/in place ofprocess/function/:resources/solution_folder/process/api/<ApiWorkflowProject>.json,resource.key→key,resource.projectKey→projectId. Never invent either. inputsandreturnscome from the sibling'sWorkflow.json:input.schema.document.propertiesandoutput.schema.document.properties, each field'stype. Itsentry-points.jsoninput/outputmay benull, so do not read them there. The sibling is not on the tenant yet; do not look it up there.checkwarns on an in-solution step with noprojectId(APIWF_LOCAL_NO_PROJECT_ID; the call resolves bykey, so a decompiled step without one is fine as is), and refuses aprojectIdthat is not a GUID (APIWF_LOCAL_PROJECT_ID_NOT_GUID) and afolderPathbesidelocation: 'in-solution'(APIWF_LOCAL_HAS_FOLDER): the in-solution binding's folder is'', filled in at deploy. IfcheckreportsAPIWF_LOCAL_NO_PROJECT_IDas an error (an older SDK), addprojectIdfromresource.projectKey. Still setprojectIdon a step you author: Studio Web's Run node reads it to deploy the sibling first.- A decompiled in-solution step (folder
'') comes back aslocation: 'in-solution'. Keep it that way when editing; never add afolderPath.
Needs @uipath/maestro-builder-sdk 6.71.1 or later: check that
dist/nodes/process/flow/spec.d.ts of the SDK copy in use declares projectId
on ApiWorkflowInputs. An older SDK has no location on apiWorkflow():
check reports APIWF_NO_FOLDER, but compile alone (6.64.0 on, it no longer
runs check) exits 0 and writes a binding keyed undefined.<name>. On an older
SDK, report the version instead of compiling the in-solution form.
Evidence boundary
Replay uses the authored contract. Live evidence should identify the real job, its input arguments, completion status, and returned output. Job completion does not by itself prove the coded workflow's business result is correct.