Context: StdOut

The last thing written to the stdout file descriptor during a run is passed to the next run. Typically, this is used to pass state between runs using a JSON encoded string of an object that includes, for example, a list of IDs of resources that have already been processed or a timestamp of the most recently processed resource. The string passed to stdout is also used to power the data behind a dynamic config.

Below is an example of how to retrieve the contents of a context variable from the environment:

import os
os.environ['PAN_CTX_LAST_SUCCESSFUL_RUN_STD_OUT']

Context Variables

Below is a list of variables that are injected into the run environment with the PAN_CTX prefix.

name
description
notes

PAN_CTX_INTEGRATION_ID

The Pandium ID of the Integration that is running currently.

an integer unique to your account

PAN_CTX_INTEGRATION_NAME

The name of the Integration that is running currently

PAN_CTX_TENANT_ID

The Pandium ID of the Tenant that is running currently.

An integer unique to your account

PAN_CTX_TENANT_NAME

The name of the Tenant that is running currently.

PAN_CTX_RUN_MODE

An enum of one of the following values: init , normal, webhook

PAN_CTX_RUN_TRIGGERS

List of objects that contain the payload data for run triggers

Can view the mode, source, and payload data as well as headers it was sent with

PAN_CTX_ENV

The environment the sync is running in, i.e. dev/staging/prod

PAN_CTX_LAST_RUN_START_TIME

A datetime that represents the time the last run started. i.e. 2021-07-24 20:04:21 +0000 UTC

Will appear in environment only after first run.

PAN_CTX_LAST_RUN_COMPLETION_TIME

A datetime that represents the time the last run completed. i.e. 2021-07-24 20:07:21 +0000 UTC

Will appear in environment only after first run.

PAN_CTX_LAST_RUN_PHASE

An enum of one of the following values: Succeeded, Failed (Platform Issue), Failed (Integration Issue) , Failed (Timeout)

Will appear in environment only after first run.

PAN_CTX_LAST_RUN_STD_OUT

The JSON encoded string that was optionally printed to stdout during last Run.

PAN_CTX_LAST_SUCCESSFUL_RUN_START_TIME

A datetime that represents the time the last successful run. i.e. 2021-07-24 20:04:21 +0000 UTC

Will appear in environment only after successful first run.

PAN_CTX_LAST_SUCCESSFUL_RUN_COMPLETION_TIME

A datetime that represents the time the last successful run completed. i.e. 2021-07-24 20:07:21 +0000 UTC

Will appear in environment only after successful first run

PAN_CTX_LAST_SUCCESSFUL_RUN_PHASE

An enum of one of the following values: Succeeded, Failed (Platform Issue), Failed (Integration Issue) , Failed (Timeout)

Will appear in environment only after successful first run

PAN_CTX_LAST_SUCCESSFUL_RUN_STD_OUT

The JSON encoded string that was optionally printed to stdout during last successful Run.

A good way to use the saved state between runs via stdout is to continue running large syncs sequentially in a 'dynamic sync' process.

Below are some examples of writing to stdout in various languages

Console.WriteLine("Hello World")

Last updated

Was this helpful?