Run Prog

What does Run Prog do?

The Run Prog directive allows you to reference and execute another Prog command within your existing Prog command.

This allows you to create smaller Progs with clear functionalities, and then assemble them as part of larger Prog commands.

At Proggy, we consider it best practices to design these smaller “Building Block” Progs to be idempotent. That is, you should be able to run these smaller Progs multiple times and they should not affect the underlying system. For more information, refer to our best practices.

Terminologies

Here are some terminologies related to this directive:

Main Prog

The Main Prog references the Prog which is used to serve as the “host” of all the other referencing Progs.

External Prog

The External Prog is the “other” Prog you are referencing under the Main Prog.

Building Block Prog

Typically functioning as an External Prog, this type of Prog represents a way of designing your command so that it can be run in an idempotent manner. There is no **Building Block** setting specifically, but this terminology is used to represent this idea that the specific Prog acts as a foundation for other more complex Progs.

How do I use the Run Prog directive?

After you have added a Step with a Run Prog directive, you can search for the external Prog you want to execute in this step. You can also directly copy and paste the URL of the other Prog (eg. https://proggy.io/official/commands/hello) here.

Run Other Prog directive settings
Run Other Prog directive settings

Behaviour of the Run Prog directive

  • When the Proggy CLI detects that there is an External Prog to run, it will fetch the steps of that Prog and execute them. The output variables of those steps will be added to your Prog command.
  • While it is technically feasible to reference these output variables, we generally do not recommend doing so unless you authored both that External Prog and the Main Prog. For this reason, it is a good idea if you are relying on a Prog written by someone else, Clone the Prog under your own account and reference your cloned version.

Example use cases for the Run Prog directive

  • If you have large programs or multiple directives you use in multiple Progs, it is recommended you break those out into smaller Building Block Progs.