DLH.io Documentation logoDLH.io Documentation
AgentsSQL Server AgentConfiguration

Lifecycle actions

Trigger DLH.io sync bridges, GitHub, GitLab or Bitbucket pipelines and dbdeux scheduled jobs before a run starts or after it completes.

Lifecycle actions let the agent kick off the next step of your pipeline as soon as fresh data has landed: refresh a warehouse through a DLH.io sync bridge, run a dbt project in CI, or start a scheduled job in dbdeux. Actions run at two points:

PhaseWhenTypical use
pre_start_actionsAfter preflight checks pass, before the first table is extractedPause a downstream refresh, warm a cluster, notify a channel that a load is starting
post_completion_actionsAfter all tables are written, uploads finished and the run summary printedRefresh Snowflake or Databricks tables, run dbt transformations, trigger downstream loads

Actions are fire-and-forget by default and never block or fail a run: an action that errors is logged and reported in the run summary as a non-blocking failure. Each phase supports up to two of each action type.

post_completion_actions:
  enabled: true
  sync_bridges:
    - name: 'Snowflake Refresh Bridge'
      guid: '<SYNC_BRIDGE_GUID>'
  cicd_dispatches:
    - name: 'Run dbt via GitHub Actions'
      provider: github
      owner: 'acme'
      repo: 'acme-dbt'
      event_type: 'dlh-agent-post-completed'
      branch: 'main'
      dbt_profile_target: 'prod'
      variables:
        source_db: 'SalesDb'
        dbt_selector: 'tag:onprem+'
      credential_ref: 'github_pat'
      wait_for_response: false
      schedule_window:
        timezone: 'America/New_York'
        days: [monday, tuesday, wednesday, thursday, friday]
        start_time: '07:00'
        end_time: '19:00'
  dbdeux_jobs:
    - name: 'Nightly dbt Transform'
      job_guid: '<DBDEUX_SCHEDULED_JOB_GUID>'
      credential_ref: 'dbdeux_svc'
      run_condition: on_success

dlh_credential__github_pat:
  credential_type: scm
  provider: github
  token: '<YOUR_GITHUB_PAT>'
  is_encrypted_credential: false

dlh_credential__dbdeux_svc:
  credential_type: api
  token: '<YOUR_DBDEUX_SERVICE_ACCOUNT_TOKEN>'
  is_encrypted_credential: false

Sync bridges

A DLH.io sync bridge moves or refreshes data inside the platform, for example refreshing Snowflake Iceberg tables over the container the agent just wrote to.

KeyDescription
nameLabel used in logs.
guidSync bridge GUID from the DLH.io platform.
schedule_windowOptional, see below.

Sync bridges use the dlh_ref.api_key and are skipped in Community mode.

CI/CD dispatches

Sends a repository_dispatch event. Your workflow must list the event_type under on.repository_dispatch.types; the variables, branch and dbt_profile_target values arrive in github.event.client_payload.

on:
  repository_dispatch:
    types: [dlh-agent-post-completed]
jobs:
  dbt:
    runs-on: ubuntu-latest
    steps:
      - run: dbt build --select "${{ github.event.client_payload.dbt_selector }}" --target "${{ github.event.client_payload.dbt_profile_target }}"

The referenced credential is a personal access token or fine-grained token with permission to dispatch events on the repository (contents: write for fine-grained tokens, repo for classic).

Creates a pipeline on workflow_ref (default main) through the gitlab.com REST API. variables are passed as pipeline variables together with DLH_RUN_ID, DLH_EVENT_TYPE, DLH_BRANCH and DLH_DBT_PROFILE_TARGET. The credential is a personal or project access token with api scope.

Starts a pipeline on workflow_ref (default main) through the bitbucket.org REST API with the variables passed as pipeline variables. The credential is a username plus app password (or a workspace access token) with pipeline write permission.

KeyDefaultDescription
providerrequiredgithub, gitlab or bitbucket.
owner, reporequiredRepository coordinates (GitLab: group and project, Bitbucket: workspace and repository slug).
workflow_refmainBranch or tag to run the pipeline on (GitLab and Bitbucket only).
event_typerequired for GitHubrepository_dispatch event type.
branchnonePassed through in the payload so branch-aware workflows know the context.
dbt_profile_targetnonePassed through in the payload as dbt_profile_target.
variables{}Key-value pairs delivered to the workflow.
credential_refrequiredName of a dlh_credential__<ref> section with credential_type: scm (write the suffix only).
wait_for_responsefalseWait for the HTTP response and log the status instead of firing and forgetting.
timeout_seconds60Wait limit when wait_for_response is true (maximum 300).

dbdeux scheduled jobs

dbdeux is the DLH.io transformation and orchestration service. A post-completion action can start one of its scheduled jobs so transformations follow every extraction without a fixed clock offset.

KeyDefaultDescription
job_guidrequiredGUID of the scheduled job in dbdeux.
credential_refrequiredName of a dlh_credential__<ref> section with credential_type: api holding a dbdeux service account token.
run_conditionon_successon_success runs only when every table succeeded, on_error only when the run had table failures or a fatal error, always in both cases. Use two entries to route success and failure to different jobs.
variables{}Extra variables merged into the job run request. The agent always adds triggered_by, agent_run_id and agent_run_status; your keys win on collision.
api_base_urldbdeux production URLOverride only when directed by DLH.io support.

dbdeux jobs are available in the post_completion_actions phase only.

Schedule windows

Any action can carry a schedule_window so that expensive downstream work only runs during business hours or on weekdays. When the agent finishes outside the window the action is skipped for that run (not deferred).

schedule_window:
  timezone: 'America/New_York'     # IANA name, default UTC
  days: [monday, tuesday, wednesday, thursday, friday]   # default all days
  start_time: '07:00'
  end_time: '19:00'

Windows are evaluated against the time the action would fire, so a five-minute agent schedule with a 07:00 to 19:00 window triggers the downstream job every five minutes during the day and never at night.

Credentials

Tokens for lifecycle actions live in named dlh_credential__* sections and are encrypted in place on the first run, exactly like storage secrets. credential_ref values omit the dlh_credential__ prefix. Rotate a token by pasting the new plaintext value and setting is_encrypted_credential: false; the next run re-encrypts it.

Pairing with a five-minute schedule

For a high-frequency agent, prefer sync bridges or dbdeux jobs (idempotent platform operations) over CI pipelines, or protect the CI action with a schedule_window and a workflow-level concurrency group, so the downstream system is not asked to rebuild every five minutes.