Skip to content

RunWhen Platform Resources

Overview

When you write a generation rule, you tell the workspace builder which resources to match by listing one or more resource types under resourceTypes. Most resource types map to cloud objects or Kubernetes kinds, but the runwhen platform exposes workspace-scoped resources that are not tied to a cloud object or Kubernetes CRD — the workspace resource type, used by MCP tool-builder codebundles.

Resource types

Resource typeScopeDescription
workspaceOne per workspace-builder runAnchor for MCP tool-builder codebundles using platform: runwhen

Template variables

When a generation rule matches a workspace resource, templates receive:

VariableValue
match_resource.nameWorkspace name
match_resource.qualified_nameWorkspace name
match_resource.owner_emailworkspaceOwnerEmail from workspaceInfo
workspace.nameWorkspace name (from base template variables)
workspace.owner_emailOwner email
default_locationDefault runner location id

Example generation rule

apiVersion: runwhen.com/v1
kind: GenerationRules
spec:
platform: runwhen
generationRules:
- resourceTypes:
- workspace
matchRules:
- type: pattern
pattern: ".+"
properties: [name]
mode: substring
slxs:
- baseName: my-task
qualifiers: ["workspace"]
baseTemplateName: my-health-check
levelOfDetail: detailed
outputItems:
- type: slx
- type: runbook
templateName: my-health-check-taskset.yaml

See the RunWhen MCP render_codecollection_skill tool for generating this layout from a tested tool-builder script — see the MCP tool-builder docs.