Skip to main content

Acceldata AWS States Adapter

acceldata_aws_states_adapter emits OpenLineage events for AWS Step Functions executions into Acceldata ADOC.

It is designed to run as an AWS Lambda (often behind EventBridge) that:

  1. Receives Step Functions execution status-change events
  2. Emits a START OpenLineage run when an execution begins (RUNNING)
  3. Walks execution history on terminal statuses and emits OpenLineage events for individual states (Task, Map, Parallel, Choice, Wait, Pass, Succeed, Fail)
  4. Sends events over HTTP to ADOC’s lineage endpoint

Python package import root: acceldata
PyPI / distribution name: acceldata_aws_states_adapter


Requirements

  • Python >= 3.10
  • Runtime dependencies: openlineage-python, boto3, attrs
  • AWS permissions for the Lambda role (see IAM permissions)
  • ADOC URL + credentials for the OpenLineage HTTP transport

Installation

From PyPI

pip install acceldata_aws_states_adapter

From TestPyPI

pip install acceldata-aws-states-adapter \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/

As a Lambda layer

Build a layer zip with a python/ prefix (Lambda’s expected layout):

mkdir -p python
pip install acceldata_aws_states_adapter \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  -t python/
zip -r layer.zip python

Attach layer.zip as a Lambda layer and keep your handler code (for example lambda_function.py) in the function package.

Editable / local development

cd modules/acceldata-aws-states-adapter
pip install -e .

How it works

EventBridge (aws.states / Step Functions Execution Status Change)
        │
        ▼
   AWS Lambda handler
        │
        ├── status == RUNNING
        │       └── ProcessorService.send_openlineage_event_for_state_machine_start(...)
        │               • describe state machine definition
        │               • build job facets (upstream / child states)
        │               • optional ParentRunFacet from execution input
        │               • emit OpenLineage START for the state machine run
        │
        └── terminal status (SUCCEEDED / FAILED / TIMED_OUT / ABORTED / ...)
                └── ProcessorService.process_step_function_execution(...)
                        • get_execution_history
                        • dispatch per-state handlers (FlowFactory)
                        • emit START/COMPLETE/FAIL/... events per state
                        • emit terminal state-machine run event + run facet

Supported Step Functions state types

State type Handler
Task Task
Map Map
Parallel Parallel
Choice Choice
Wait Wait
Pass Pass
Succeed Success
Fail Fail

Handlers live under acceldata.step_functions.flows and are registered in FlowFactory.

OpenLineage mapping (high level)

Concept Typical value
Job namespace From ADOC__OPENLINEAGE__NAMESPACE, or default aws-<accountId>-<region> derived from the state machine ARN
State machine job name State machine name (ARN suffix)
State job name <stateMachineName>.<stateName>
State machine run id Step Functions execution name / id
Parent run Optional, from execution input keys aws.states.openlineage.*

Custom facets include:

  • AWSStateMachineJobFacet — upstream and child state topology
  • AWSStateMachineRunFacet — per-state terminal status map
  • AWSStateMachineStateInputDetailsFacet / AWSStateMachineStateOutputDetailsFacet — entered/exited state details

Events are posted to ADOC at:

{ADOC__OPENLINEAGE__TRANSPORT__URL}/torch-pipeline/api/v1/lineage

using HTTP headers accessKey and secretKey.


Configuration

Configure the Lambda (or process) with these environment variables.

Required ADOC transport

Environment variable Description
ADOC__OPENLINEAGE__TRANSPORT__URL ADOC base URL (host only; endpoint path is appended by the client)
ADOC__OPENLINEAGE__TRANSPORT__ACCESS_KEY ADOC access key
ADOC__OPENLINEAGE__TRANSPORT__SECRET_KEY ADOC secret key (unless Secrets Manager is enabled)

Optional

Environment variable Description
ADOC__OPENLINEAGE__NAMESPACE OpenLineage job namespace override (recommended human-readable account/env name)
ADOC__OPENLINEAGE__TRANSPORT__SECRET_MANAGER_ENABLED Set to true to load the secret key from AWS Secrets Manager
ADOC__OPENLINEAGE__TRANSPORT__SECRET_MANAGER_SECRET_NAME Secrets Manager secret id/name
ADOC__OPENLINEAGE__TRANSPORT__SECRET_MANAGER_REGION Region for the Secrets Manager client

If ADOC__OPENLINEAGE__NAMESPACE is unset, the adapter defaults to:

aws-<accountId>-<region>

parsed from the state machine ARN (for example aws-241571801844-ap-south-1).

Parent run (optional)

If the Step Functions execution input JSON includes all of:

  • aws.states.openlineage.parentRunId
  • aws.states.openlineage.parentJobName
  • aws.states.openlineage.parentJobNamespace

the START event for the state machine run includes an OpenLineage ParentRunFacet.

Example execution input fragment:

{
  "TransactionType": "PURCHASE",
  "aws.states.openlineage.parentRunId": "1f0f2305-6017-42a6-af78-002fec15eba2",
  "aws.states.openlineage.parentJobName": "Step Functions StartExecution",
  "aws.states.openlineage.parentJobNamespace": "TriggerStateMachine"
}

IAM permissions

Minimum permissions typically required by the Lambda role:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "states:DescribeStateMachine",
        "states:GetExecutionHistory"
      ],
      "Resource": "*"
    }
  ]
}

If using Secrets Manager for the ADOC secret key, also allow:

{
  "Effect": "Allow",
  "Action": ["secretsmanager:GetSecretValue"],
  "Resource": "arn:aws:secretsmanager:<region>:<account-id>:secret:<secret-name>*"
}

Tighten Resource ARNs to specific state machines / secrets in production.


Usage (Lambda handler)

Wire EventBridge rule(s) for Step Functions Execution Status Change to a Lambda. Example handler:

import json

from acceldata.client.client_initialiser import ClientInitialiser
from acceldata.service.processor_service import ProcessorService


def lambda_handler(event, context):
    event_details = event["detail"]
    status = event_details["status"]

    client = ClientInitialiser.initialise_client_configuration().client
    service = ProcessorService(openlineage_client=client)

    if status == "RUNNING":
        service.send_openlineage_event_for_state_machine_start(
            state_machine_arn=event_details["stateMachineArn"],
            execution_id=event_details["name"],
            event_time=event_details["startDate"],
            event_details=event_details,
        )
    else:
        # SUCCEEDED / FAILED / TIMED_OUT / ABORTED / etc.
        service.process_step_function_execution(
            state_machine_arn=event_details["stateMachineArn"],
            state_machine_execution_arn=event_details["executionArn"],
            client=client,
        )

    return {"statusCode": 200, "body": json.dumps("ok")}

Expected EventBridge shape

The adapter expects the standard EventBridge envelope. The handler uses event["detail"], which includes fields such as:

  • status
  • name (execution id)
  • stateMachineArn
  • executionArn
  • startDate (epoch millis)
  • input (JSON string of the execution input, when included)

Package layout

acceldata/
  client/           # ADOC OpenLineage HTTP client + env/Secrets Manager bootstrap
  constants/        # Env var names and Step Functions field constants
  facets/           # Custom OpenLineage facets for AWS Step Functions
  service/          # ProcessorService + Step Functions describe/history services
  step_functions/   # FlowFactory, utils, per-state flow handlers

Primary entry points for integrators:

  • acceldata.client.client_initialiser.ClientInitialiser
  • acceldata.service.processor_service.ProcessorService

Building and publishing

cd modules/acceldata-aws-states-adapter
pip install -U build twine
rm -rf dist/ build/ *.egg-info
python -m build
twine check dist/*

# TestPyPI
twine upload --repository testpypi dist/*

# PyPI (after validation)
twine upload dist/*

Version is read from the VERSION file (dynamic setuptools version).


License

MIT — see LICENSE.

Metadata

Release files for acceldata-aws-states-adapter 26.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acceldata-aws-states-adapter 26.9.0
File Size Uploaded Provenance
acceldata_aws_states_adapter-26.9.0.tar.gz 32.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for acceldata-aws-states-adapter 26.9.0
File Interpreter ABI Platform
acceldata_aws_states_adapter-26.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.4 kB

Release files / acceldata_aws_states_adapter-26.9.0.tar.gz

Download URL acceldata_aws_states_adapter-26.9.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bed0dfe34710906ea846db46fa94646102b5c2d281a9a9c307c5f19e15821da6
BLAKE2b-256 checksum
How to use checksums
7000363814fb6c43e14b6ac5854d45714fd4e1205a1eded43f6a1c0e37fa40c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / acceldata_aws_states_adapter-26.9.0-py3-none-any.whl

Download URL acceldata_aws_states_adapter-26.9.0-py3-none-any.whl
Size 34.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
596b30bea58fa51bc3a64cdee8936e7e71ab8a6dfaf09930d257133e63311b2e
BLAKE2b-256 checksum
How to use checksums
9fa43da11a1bb55c0c6fb6f7a7f8a974c94531257d33ec29b0a68f12ea3d8dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for acceldata-aws-states-adapter 26.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

26.9.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page