terraform-provider-stackgen

sg_app_workflow_selection (Data Source)

⚠️ Experimental — Resolves a Guild app-declared purpose to a workflow using the selection-only API. The endpoint uses POST but does not run a workflow, change assignments, or persist a server-side selection. Without requested_workflow_name, Guild selects the custom default or provisioned workflow for the purpose. Scoped to the provider’s workspace_id when set.

Example Usage

# The installed app must declare this purpose in workflow_purposes.
# Omit requested_workflow_name to use the custom default or provisioned workflow.
# This lookup selects a name; it does not execute or persist a workflow.
# WARNING: Terraform state retains the resolved workflow name; protect state access.
data "sg_app_workflow_selection" "investigation" {
  app_name = "sre"
  purpose  = "investigate_alert"
}

output "investigation_workflow_name" {
  value = data.sg_app_workflow_selection.investigation.workflow_name
}

# To use a custom workflow instead, first attach an approved workflow with
# sg_app.workflow_assignments (purpose, workflow_name, optional is_default),
# then set requested_workflow_name to that assigned name if needed.

Schema

Required

Optional

Read-Only