REST
Last updated
Last updated
The specification also supports describing REST invocations in the functions definition using .
Here is an example function definition for REST requests with method GET
and request target corresponding with /users/{id}
:
The function can be referenced during workflow execution when the invocation of the REST service is desired. For example:
Example of the POST
request sending the state data as part of the body:
You can reference the createUser
function and filter the input data to invoke it. Given the workflow input data:
Function invocation example:
In this case, only the contents of the user
attribute will be passed to the function. The user ID returned by the REST request body will then be added to the state data:
Note that the Function Definition's operation
property must follow the specification definition.
Note that the requestBody
is described inline rather than a reference to an external document.
The specification does not support the since its redundat to function Auth Definition. If provided, this field is ignored.