Invoke Playbook
Invoke Playbook
Section titled “Invoke Playbook”Type: invoke-playbook · Package: Core Activities v1.0.0
Runs another playbook of the same project, optionally passing input data to it and receiving its results back. It’s the tool to break a large automation into small pieces and reuse logic: instead of copying and pasting the same group of activities in multiple places, you put it in a sub-playbook and invoke it.
How it works
Section titled “How it works”- Runs the playbook indicated in
path, passing it the values ofinput. - The sub-playbook runs from start to finish with its own variable space (it does not see or modify those of the playbook that called it).
- Upon completion, its outputs are mapped to variables of the current playbook according to
outputs. - If the sub-playbook fails, the invocation fails (catchable with Try / Catch).
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | selector de playbook | The child playbook to run. relative path within the project. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
input | tickets | Values that the sub-playbook receives, as nombre: valor pairs. |
outputs | salidas | Mapping the child’s outputs to variables of the current playbook. |
Example
Section titled “Example”For each invoice, invoke a sub-playbook that processes it and returns a status:
For Each items = = facturas itemVariable = factura └─ activities: Invoke Playbook path = "procesar-factura.json" input = = { factura: factura, reintentos: 3 } outputs = = { estado: estadoProcesamiento } Log level = info message = = "Factura procesada: " + estadoProcesamientoinput: The child receivesfacturaandreintentosas input variables.outputs: Theestadooutput of the child is saved in theestadoProcesamientovariable of the parent.
Related activities
Section titled “Related activities”- Variables — how inputs are passed and outputs received.
- Try / Catch — handle failure of a sub-playbook.
- Designer Overview — projects with multiple playbooks.