Skip to Content

There are scenarios where you might want to use a variable stored in one iFlow and call it from another process in CPI or to query OData based on the last successful run from another IFlow. Write Variables is one such functionality provided by SAP in CPI/HCI.

Scenario: Save the last Successful run date of my IFLOW1 and check the last successful run in my next IFLOW2

I’ve used a very simple iFlow to explain the procedure. The same can be used when you need to query other systems based on the variable stored in another iFlow.

In IFlow1: add step Write Variables:

I have added additional steps to check whether my variable has any value or not.



Below are the details in the properties tab, in case I wanted to save the currentDate:

Note: Tick the GobalScope option in properties.

In Flow2: Add Step ContentModifier with below properties:

Note: Save it as Global Variable, else this property would not have any value assigned to it.

In the second Content Modifier, I’ve used the property in my output file:

Deploy iFlow1 first and then iFlow2.

Output for iFlow1:

Output of iFlow2 with the last run date of iFlow1:

Write Variable can also be used in the same iFlow as local variable- save it as a property or header and use it anywhere in your iFlow.

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Pravesh Shukla

    Hi Merina,

    Nice Blog!

    I have one question ,that is it good practise to use Write Variables at the beginning of i flow, as we have to store LastSuccessFull run but if in case due to some reasons i flow fails, then what?

    As per my understanding it should come before the end message event.

    Make sense?



    Pravesh Shukla

    1. Merina Acharya Post author

      HI Pravesh,


      Yeah you are right, but ive used it here only as an example to show how this functionality works.





Leave a Reply