How-To: Integrate a Pliant Flow into External Systems
One of the most powerful things about Pliant is its ability to serve as middleware integrating various systems in an enterprise or even serve as a backend to new custom UIs and dashboards. To accomplish this, Pliant workflows must be easily invoked over a standardized channel. The preferred method is via the built-in REST-ful endpoint that gets generated with every Flow.
This is a short tutorial on how to create and invoke a workflow from an external system via its REST-ful endpoint.
- Let's start by creating a new flow.
Then give it the name ExampleEvent1
It is VERY IMPORTANT that your flow has the string 'Event' (case insensitive) somewhere in its name. This is only required for flows that will be invoked externally.
This is no longer a requirement
- In the bottom of the Start Block, you will see a short snippet giving an example of how the workflow can be invoked through a CURL command. This example will work with any flow and is great for testing. Keep in mind that the token in the example is only valid for 24 hours, however. For permanent usage, follow the rest of this guide.
- Now create a short example flow - one input variable assigning its value to an output variable. The input variable has a default value of 'Hello World' so if we run the flow - we will see a result right away.
- Notice the input variable is listed at the bottom of the example CURL call.
- To invoke our ExampleEvent1 flow externally we take the URL listed in the CURL example, copy it and paste it into a new browser tab.
- Add api_key to the path as query parameter.
- Execute the request and you will see the output 'Hello World' along with a uuid identifying this particular execution of the workflow.
- Since we had defined the input variable input we can now pass it a different value from the default one we had set in the Flow. Let's pass it the string 'Hello There'. Note how we appended the URL.
We hope this short tutorial was helpful. For additional questions - please contact us directly!