| 1 |
Create & Run a Flow |
| 2 |
=================== |
| 3 |
|
| 4 |
These examples guide you through creating and running a **flow** using the Globus |
| 5 |
Flows service. |
| 6 |
|
| 7 |
Note that users are restricted to only creating one **flow** unless covered by a |
| 8 |
Globus subscription. Therefore, these examples will also include an option to |
| 9 |
delete your **flow**. |
| 10 |
|
| 11 |
|
| 12 |
Create and Delete Hello World Flow |
| 13 |
---------------------------------- |
| 14 |
|
| 15 |
This script provides commands to create, list, and delete your **flows**. |
| 16 |
The **flow** definition used for it is simple and baked into the script, but this |
| 17 |
demonstrates the minimal **flow** creation and deletion process. |
| 18 |
|
| 19 |
.. literalinclude:: manage_flow_minimal.py |
| 20 |
:caption: ``manage_flow_minimal.py`` [:download:`download <manage_flow_minimal.py>`] |
| 21 |
:language: python |
| 22 |
|
| 23 |
|
| 24 |
Run a Flow |
| 25 |
---------- |
| 26 |
|
| 27 |
This next example is distinct. It runs a flow but has no capability to create |
| 28 |
or delete a flow. Note how ``SpecificFlowClient`` is used -- this class allows |
| 29 |
users to access the flow-specific scope and provides the methods associated |
| 30 |
with that scope of running **flows** and resuming **runs**. |
| 31 |
|
| 32 |
The login code is slightly different from the previous example, as it has to |
| 33 |
key off of the Flow ID in order to act appropriately. |
| 34 |
|
| 35 |
.. literalinclude:: run_flow_minimal.py |
| 36 |
:caption: ``run_flow_minimal.py`` [:download:`download <run_flow_minimal.py>`] |
| 37 |
:language: python |
| 38 |
|
| 39 |
|
| 40 |
Create, Delete, and Run Flows |
| 41 |
----------------------------- |
| 42 |
|
| 43 |
The following example combines the previous two. |
| 44 |
It has to further enhance the login code to account for the two different |
| 45 |
styles of login which it supports, but minimal other adjustments are needed. |
| 46 |
|
| 47 |
Depending on the operation chosen, either the ``FlowsClient`` or the |
| 48 |
``SpecificFlowClient`` will be used, and the login flow will also be |
| 49 |
appropriately parametrized. |
| 50 |
|
| 51 |
.. literalinclude:: manage_flow.py |
| 52 |
:caption: ``manage_flow.py`` [:download:`download <manage_flow.py>`] |
| 53 |
:language: python |