Access to data in a script follows typical programming concepts. Any local variables defined in the script are only available to that instance of the script while it is running. If you want shared/global data you should store the data in the global data context.
In a workflow:
workflow.addProperty() / workflow.properties.<propertyname>
In a playbook:
playbook.addProperty() / playbook.properties.<propertyname>
These are available from the time they are first added to the time the workflow/playbook ends.
Ben
------------------------------
Ben Lurie
------------------------------
Original Message:
Sent: Wed March 23, 2022 08:24 AM
From: Leonardo Kenji Shikida
Subject: Reference variables from pre-process script in post-process script
I believe you can store your variable in the workflow scope.
I think every piece of python code is sent separately to local process in the same SOAR console machine and processed as a snippet. In this case, you can't think on pre-process and post-process as part of the same processing unit. That's probably why SOAR has this concept of storing things in the workflow scope.
Please someone correct me if I am wrong. This is just the feeling I have about how things work behind the curtains.
[]
Leonardo Kenji Shikida
------------------------------