the ResultPath parameter controls where the output of a state is stored. This adds the option to store the results in the workflow Credentials hash allowing the value to be referenced by future states.
This can be used by the Task and Pass states.
Examples:
Say we have a task which logs into a service with a username/password and returns the bearer token:
If the output of the container doesn't match exactly what you want to set in the Credentials payload you can use the ResultSelector to manipulate it, say the output is in '{"results": "token"}':
If you don't have a static Result the Pass state works on Input so you could use Pass to send Input to Credentials. I don't think this is going to be particularly useful but I wanted to keep the behavior of ResultPath consistent across states.
the
ResultPath
parameter controls where the output of a state is stored. This adds the option to store the results in the workflowCredentials
hash allowing the value to be referenced by future states.This can be used by the
Task
andPass
states.Examples:
Say we have a task which logs into a service with a username/password and returns the bearer token:
floe --credentials '{"username": "foo", "password": "bar"}' ...
You can also use
ResultPath
to set nested values, e.g.:And then access it like:
If the output of the container doesn't match exactly what you want to set in the Credentials payload you can use the
ResultSelector
to manipulate it, say the output is in'{"results": "token"}'
:You can also use
Pass
states to manipulate the output and set a credential valueIf you don't have a static
Result
thePass
state works on Input so you could use Pass to send Input to Credentials. I don't think this is going to be particularly useful but I wanted to keep the behavior ofResultPath
consistent across states.