Skip to main content

Custom Workflow

A Custom workflow allows customers to bring any environment or toolset onto the platform, beyond what is already available (such as Ansible, Kubernetes, or CloudFormation). It offers IT teams the flexibility to create and execute workflows tailored to their specific needs, enabling automation beyond standard options.

The versatility of custom workflows allows for the automation of processes that do not fall under conventional workflow types.

Prerequisites​

  • Create a personalized Workflow Steps Template to use within the workflow. Visit here for detailed instructions.

Create a Custom Workflow​

Once the workflow steps template is ready, follow these steps to create a custom workflow:

  1. Navigate to the Workflow Group, click Create Workflow, and choose "Use Wizard" > "Custom".

  2. StackGuardian provides two options:

  • Enable VCS settings to connect your code from the Git repository by providing the URL, then click "Next".
  • Or simply, click "Next" to proceed without it.
  1. Click "Add New Step" and configure the following:
  • Step Name: Enter a relevant name for the workflow step.
  • Workflow Step Template: Select the template created earlier.
  • Workflow Step Template Revision: Choose the latest version.
  • Command Override: Leave blank unless customization is required.
  1. Click Next to update the workflow metadata and Launch to execute the workflow.

Custom Workflow Example​

Subscribe and use StackGuardian's SG-Common-Utils-Template, which provides a pre-configured environment with tools like cloud provider CLIs, Python, essential libraries such as Boto3, Google Cloud SDK, and more.

Following this example, let's configure a custom workflow to execute Bash and Python scripts.

  1. Navigate into the Workflow Group, click Create Workflow and choose "Use Wizard" > "Custom".

  2. Click Next to continue without Enabling VCS settings.

  3. Click on "Add New Step" and configure it as follows:

Bash Script​

Ideal for more complex tasks like data analysis, API interactions, or any process requiring dynamic decision-making.

  • Step Name: Enter a relevant name, such as "bash".
  • Workflow Step Template: Select /stackguardian/sg-common-utils.
  • Workflow Step Template Revision: Choose the latest version, e.g., sg-common-utils:1.

Python Script​

Can be used to automate server configurations, manage files, or interact with cloud services using command-line tools.

  • Step Name: Enter a relevant name, such as "python".
  • Workflow Step Template: Select /stackguardian/sg-common-utils.
  • Workflow Step Template Revision: Choose the latest version, e.g., sg-common-utils:1.
  1. After configuring the workflow step, click Next to fill in the workflow metadata. Finally, click Next to launch the workflow.

Fig: Custom Workflow executing Bash and Python scripts

Using this setup, one can create a robust, tailored workflow that automates specific tasks and processes within their organization.

Dive into Workflow​

StackGuardian workflows provide multiple tabs for monitoring, managing, and refining your deployments. Each tab offers specific insights and actions to optimize your workflow experience.

Overview​

The Overview tab highlights key workflow details, including compliance check results, cost estimations, and resource summaries like drift detection and schedules. It offers a quick snapshot of your workflow's status.
Learn more in the Workflow Overview Guide.


Runs​

The Runs tab lists all executions with real-time status, unique run IDs, and metadata, such as user actions and modification timestamps. Click a Run ID to view detailed logs and execution progress.
Explore the Workflow Runs Guide.


Outputs​

The Outputs tab displays execution results and downloadable artifacts like tfstate.json. Use key-value pairs to reference outputs in other workflows, making your infrastructure provisioning more dynamic.
See the Workflow Outputs Guide.


Settings​

The Settings tab enables post-creation updates, such as modifying input variables, refining Terraform runtime settings, reordering custom steps, or managing cloud connectors and environment variables.
Learn more in the Workflow Settings Guide.