Skip to content

Advanced Workflow Templates

Omnistrate system and custom workflows support an Argo-compatible subset for orchestrating Kubernetes resources, groups of containers, and HTTP requests. Use these templates to add validation, data preparation, callbacks, and other workflow steps without deploying an Argo controller.

Supported Template Types

Each item in templates must define exactly one supported template type.

Template Use case Support
dag Order tasks and pass parameters or outputs between them. Supported
resource Apply, patch, get, or delete a Kubernetes resource. Supported
containerSet Run dependent containers in one ephemeral Kubernetes Pod. Supported subset
http Make an HTTP request from the data plane agent (DPA). Supported subset
container Run one Argo container template. Not currently supported; use a one-container ContainerSet.
Inline templates Define a template directly inside a DAG task. Not supported; define a named template and reference it with template.

This is not full Argo Workflows compatibility. Omnistrate stores and executes the workflow specification directly; it does not create an Argo Workflow custom resource. An inline workflow must begin with fields such as entrypoint, arguments, and templates. An external workflowFile can contain either that specification body or an Argo document with apiVersion: argoproj.io/v1alpha1, kind: Workflow, and the supported fields under spec.

Parameter and Output Expressions

Omnistrate resolves expressions in two stages:

  1. Top-level workflow.arguments.parameters can use Omnistrate expressions such as $sys.*, $var.*, $secret.*, and $func.*.
  2. DAG task arguments pass those values to named templates with {{inputs.parameters.<name>}}. ContainerSet and HTTP fields support these input references.

Use completed task outputs in downstream DAG task arguments:

arguments:
  parameters:
    - name: stdout
      value: "{{tasks.build.outputs.result}}"
    - name: file-output
      value: "{{tasks.build.outputs.parameters.build-result}}"
    - name: response-body
      value: "{{tasks.check.outputs.result}}"

outputs.result is the implicit ContainerSet or HTTP result. outputs.parameters.result is a named output parameter whose name happens to be result; these references are distinct.

ContainerSet Templates

A ContainerSet template creates one ephemeral Pod in the Resource namespace. Its containers can share emptyDir volumes and declare dependencies on other containers in the same set. The DPA waits for the Pod to finish, extracts outputs or errors, records workflow diagnostics, and deletes the Pod.

The Pod is not persisted as an Omnistrate infrastructure resource. Use the workflow execution and Debug Events after cleanup instead of expecting the Pod to remain.

ContainerSet example

entrypoint: build
templates:
  - name: build
    activeDeadlineSeconds: 600
    volumes:
      - name: workspace
        emptyDir: {}
    containerSet:
      volumeMounts:
        - name: workspace
          mountPath: /workspace
      retryStrategy:
        retries: "2"
        duration: 2s
      containers:
        - name: prepare
          image: ghcr.io/omnistrate/alpine:3.23.3
          command: [sh, -c]
          args:
            - mkdir -p /workspace/output && printf '%s' ready > /workspace/input
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 500m
              memory: 128Mi
        - name: main
          image: ghcr.io/omnistrate/alpine:3.23.3
          dependencies: [prepare]
          command: [sh, -c]
          args:
            - cp /workspace/input /workspace/output/result && cat /workspace/output/result
    outputs:
      parameters:
        - name: build-result
          valueFrom:
            path: /workspace/output/result

The example exposes:

  • {{tasks.build.outputs.result}}: standard output from the main container.
  • {{tasks.build.outputs.parameters.build-result}}: the contents of /workspace/output/result.

ContainerSet requirements and limits

  • Only emptyDir volumes are supported. ConfigMap, Secret, persistent volume claim, host path, projected, and other volume sources are rejected.
  • Every container must have a unique DNS-label name and an explicit command.
  • The container image must include /bin/sh. Omnistrate wraps the configured command to enforce dependencies, retries, status reporting, and output collection.
  • dependencies must reference containers in the same set and cannot contain duplicates or cycles.
  • Kubernetes resources.requests and resources.limits are passed to the Pod.
  • retryStrategy.retries is the number of retries after the first attempt. duration is a Go duration such as 250ms, 2s, or 1m.
  • activeDeadlineSeconds can be set on the workflow or template. A template deadline overrides the workflow deadline.
  • Named output paths must be absolute, must be on an emptyDir volume mounted by the main container, and must exist when main succeeds.
  • A container named main is required for named outputs and for the implicit stdout result.
  • Outputs are transported through Kubernetes termination messages. Each result collector has a 4,096-byte message limit, and Kubernetes retains at most 12 KiB of termination messages across the Pod. Budget the main result, all named outputs, and message overhead together, and leave headroom below both limits.
  • Failed containers report their container name, exit code, reason, and bounded logs. Scheduling, image-pull, out-of-memory, dependency, deadline, output collection, and cleanup failures are also surfaced in workflow diagnostics.

retryStrategy retries the process inside the same Pod. It does not recreate the Pod or reset an emptyDir volume between attempts.

ContainerSet Debug Events retain the rendered Pod manifest and relevant Kubernetes events, in addition to per-container failure details. This information remains available after the ephemeral Pod is deleted.

HTTP Templates

An HTTP template asks the DPA running in the target data plane to make the request. The request therefore uses data plane DNS and network reachability, which allows access to permitted cluster-local services.

HTTP example

entrypoint: notify
arguments:
  parameters:
    - name: endpoint
      value: "{{ $var.callbackEndpoint }}"
templates:
  - name: notify
    inputs:
      parameters:
        - name: endpoint
    http:
      method: POST
      url: "{{inputs.parameters.endpoint}}"
      headers:
        - name: Content-Type
          value: application/json
        - name: Authorization
          valueFrom:
            secretKeyRef:
              name: workflow-callback-credentials
              key: authorization
      body: '{"state":"ready"}'
      timeoutSeconds: 30
      successCondition: response.statusCode >= 200 && response.statusCode < 300

The response body is available as {{tasks.notify.outputs.result}}. If successCondition is omitted, any 2xx response succeeds and other status codes fail the task.

Use bodyFrom.bytes for binary request content represented as base64 in YAML. body and bodyFrom are mutually exclusive:

http:
  method: POST
  url: https://example.com/upload
  bodyFrom:
    bytes: aGVsbG8=

Success conditions

successCondition must evaluate to a Boolean. It can use:

  • request.method, request.url, request.body, request.bodyBytes, and request.headers.
  • response.statusCode, response.body, and response.headers.

For example:

successCondition: response.statusCode == 202 && response.body contains "accepted"

HTTP security and limits

  • Only http and https URLs are accepted. URLs containing user information are rejected.
  • TLS certificates are verified by default. insecureSkipVerify: true disables certificate and hostname verification and should only be used for a controlled endpoint when secure verification cannot be configured.
  • Redirects are not followed. A 3xx response is evaluated as the final response.
  • Process-level HTTP proxies are disabled for these requests.
  • The destination policy blocks loopback, link-local, multicast, the Kubernetes API, DPA-local addresses, and known cloud metadata endpoints. DNS results are checked again when the connection is opened.
  • Private and cluster-local destinations are allowed when they pass the destination policy and are reachable from the DPA.
  • Request bodies and response bodies are limited to 1 MiB each. Request and response headers are limited to 64 KiB.
  • The default timeout is 30 seconds and the maximum is 300 seconds.
  • Each DPA process permits up to 10 concurrent HTTP template requests.
  • HTTP requests are not automatically retried. Retrying a request could duplicate a non-idempotent operation, and a transport failure can be indeterminate if the remote server received the request before the connection failed.
  • Secret-backed header values are read from the Kubernetes Secret in the Resource namespace. Secret values are not exported as workflow outputs.
  • Response bodies become workflow data and follow the same access and retention behavior as other workflow outputs. Do not return credentials or unnecessary sensitive data.

HTTP task diagnostics include the response status code and bounded, redacted response details. Sensitive fields such as passwords, secrets, tokens, API keys, private keys, and credentials are redacted before they are added to Debug Events.

Helm Custom Workflows and Validation

Helm-backed Resources can define customWorkflows and the systemWorkflows.validation system workflow next to helmChartConfiguration on the root Resource:

services:
  - name: web
    helmChartConfiguration:
      chartName: nginx
      chartVersion: 18.2.4
      chartRepoName: bitnami
      chartRepoURL: https://charts.bitnami.com/bitnami
      chartValues:
        fullnameOverride: web

    customWorkflows:
      - verb: smokeTest
        displayName: Run smoke test
        scope: [FLEET]
        workflow:
          entrypoint: smoke
          arguments:
            parameters:
              - name: namespace
                value: "{{ $sys.namespace }}"
          templates:
            - name: smoke
              inputs:
                parameters:
                  - name: namespace
              http:
                method: GET
                url: "http://web.{{inputs.parameters.namespace}}.svc.cluster.local/"
                timeoutSeconds: 30

    systemWorkflows:
      validation:
        workflow:
          entrypoint: validate
          arguments:
            parameters:
              - name: operation
                value: "{{ $sys.validation.operation }}"
              - name: namespace
                value: "{{ $sys.namespace }}"
          templates:
            - name: validate
              inputs:
                parameters:
                  - name: operation
                  - name: namespace
              dag:
                tasks:
                  - name: preflight
                    template: preflight
                    arguments:
                      parameters:
                        - name: operation
                          value: "{{inputs.parameters.operation}}"
                  - name: endpoint
                    template: endpoint
                    dependencies: [preflight]
                    arguments:
                      parameters:
                        - name: namespace
                          value: "{{inputs.parameters.namespace}}"
                        - name: context
                          value: "{{tasks.preflight.outputs.result}}"
            - name: preflight
              inputs:
                parameters:
                  - name: operation
              containerSet:
                containers:
                  - name: main
                    image: ghcr.io/omnistrate/alpine:3.23.3
                    command: [sh, -c]
                    args: ['printf "validating %s" "{{inputs.parameters.operation}}"']
                    resources:
                      requests:
                        cpu: 50m
                        memory: 32Mi
            - name: endpoint
              inputs:
                parameters:
                  - name: namespace
                  - name: context
              http:
                method: GET
                url: "http://web.{{inputs.parameters.namespace}}.svc.cluster.local/"
                headers:
                  - name: X-Validation-Context
                    value: "{{inputs.parameters.context}}"
                timeoutSeconds: 30
                successCondition: response.statusCode == 200

A custom workflow is an explicit provider-defined action that you invoke from the UI, API, or CLI. It does not replace the Helm install or upgrade operation. The Validation system workflow is different: Omnistrate invokes it automatically as part of supported lifecycle mutations.

Post-Operation Validation

Define systemWorkflows.validation to run custom validation logic after a successful create, modify, or restore deployment step. The Validation system workflow can combine DAG, Kubernetes resource, ContainerSet, and HTTP templates. Define it under systemWorkflows, not customWorkflows.

  • $sys.validation.operation is CREATE, MODIFY, or RESTORE for the operation that triggered validation.
  • Instance patches, parameter updates, and version upgrades that use the update lifecycle are reported to validation as MODIFY.
  • Validation does not run after delete, start, stop, or an explicitly invoked custom workflow.
  • Omnistrate waits for validation to finish before marking the parent operation successful.
  • A failed validation task fails the parent create, modify, or restore operation and includes the validation task diagnostics in the workflow error and Debug Events.
  • Validation events appear in the workflow visualization under the Validation group, separate from explicitly invoked Custom workflow operations.
  • Validation does not automatically roll back the Helm release or other deployed resources. They remain available for investigation or a subsequent corrective operation.
  • If systemWorkflows.validation is not defined, the lifecycle operation continues without this post-operation step.

Troubleshooting

Symptom Checks
Advanced template is rejected during Plan build Confirm each template defines exactly one supported type and review the reported fieldPath and remediation guidance.
ContainerSet Pod remains pending Check scheduling events, requested resources, service account permissions, image-pull credentials, and cluster capacity in Instance Debug.
Container exits immediately Confirm the image contains /bin/sh, every container has an explicit command, and dependency names are correct.
ContainerSet output is missing or truncated Confirm the output is written before main exits, its path is on a mounted emptyDir, and it stays within termination-message limits.
HTTP request cannot connect Check the rendered URL, DNS, data plane network policy, destination restrictions, and whether the endpoint is reachable from the DPA rather than from your local environment.
HTTP request fails TLS verification Install a trusted certificate or correct the hostname. Use insecureSkipVerify only after evaluating the security impact.
HTTP request fails on 3xx Configure the final URL because redirects are intentionally disabled.
HTTP task fails despite receiving a response Check the status code, response size, and successCondition. The condition must compile and return a Boolean.
Validation fails a lifecycle operation Expand the validation task in the workflow, inspect Debug Events and rendered inputs, and remember that the deployed resources are not automatically rolled back.

For execution history and diagnostics, see Manage Workflows. For the upstream concepts that inspired this subset, see the Argo ContainerSet template and Argo HTTP template documentation.