Actions (or Steps) are the fundamental pieces that build up a zenphi Flow. Each Action consists of various properties such as Settings, Output, and Error Handling. In this article we'll learn what is an Output of an Action.
Zenphi actions may contain Outputs or may not. If an action item holds Output variables or tokens, these will be available to use in all the following Action items in the zenphi Flow. Let’s have a look at the following example.
We are going to use some action items from the PDF category. In this example, a given HTML document will convert to a PDF file named ‘indexpage’. Then the created file will be used as input in the next steps as follows.
Drag and drop the ‘Convert HTML to PDF’ action from the left panel. We can inspect the properties associated with this action by clicking on the cogs icon. Let’s check the ‘Output’ tab as shown in the following.
As you can see in the Output tab, There are three output variables/tokens associated with this particular action as listed in the following.
The Name or Size of the created PDF document and the generated PDF document object can be accessed with those token identifiers in any of the subsequent steps of a Zenphi workflow. Let’s see how we can access these outputs in the next action of this example workflow.
The ‘Extract Pages’ action is used to extract one or multiple pages from a provided PDF document and generate a whole new PDF. Let’s look at the configuration settings for this action as shown in the following.
The Source Document field expects a token. So, we can provide the PDF Document which is one of the outputs from the earlier step. To do that, you can click on the Insert Tokens icon that will display the Insert Tokens dialogue as follows.
As expected, it already suggests the available and matching outputs from the previous workflow actions that make your life easy. In this scenario, we can add the PDF Document token by clicking on the add button next to the identifier.
Another place we can use the previous step’s output is in the Output Document field which also accepts tokens from previous actions. Let’s use the Name of the PDF document that has been created in the previous step as the file name for the generated document in this action.
You can click on the add icon next to the Name identifier and it will be added to the Output Document field as follows.
To summarize, in the first step(Convert HTML to PDF Action), a PDF document has been created with the name converteddoc.pdf. Then in the Extract Pages action, we used two output tokens from the earlier step namely the PDF Document and Name tokens.