Modules

A module is a customer-owned Lambda that StrataBI invokes to back a tile. Modules extend the runtime with custom compute without changing core.

Using a module from a tile

Set exec.type to lambda and reference the module by id and function index:

json
{ "exec": { "type": "lambda", "module_id": "sales_demo", "lambda_index": 0 } }

StrataBI resolves module_id + lambda_index to a concrete Lambda ARN through the module registry. You never put raw ARNs in a dashboard.

The module Lambda contract

When a tile runs, core invokes your Lambda asynchronously with an event. The important fields:

text
event["status_context"]   { system_bucket, result_s3_key, result_kind,
                            result_format, runtime_tile_key, run_id, ... }
event["inputs"]           resolved dashboard inputs
event["tile"]             the full tile config
event["run_id"]           this run's id
event["status_writer_lambda_arn"]   optional central status writer

Your Lambda must:

  1. Write its result artifact to s3://{system_bucket}/{result_s3_key}.
  2. Report final status SUCCEEDED (or FAILED) keyed by

(runtime_tile_key, run_id) — via the status writer Lambda when provided, otherwise directly to the status table.

python
def lambda_handler(event, context):
    ctx = event["status_context"]
    write_status(event.get("status_writer_lambda_arn"), ctx, "RUNNING")
    try:
        # ... produce result ...
        s3.put_object(Bucket=ctx["system_bucket"], Key=ctx["result_s3_key"], Body=body)
        write_status(event.get("status_writer_lambda_arn"), ctx, "SUCCEEDED")
    except Exception as exc:
        write_status(event.get("status_writer_lambda_arn"), ctx, "FAILED",
                     message=str(exc))
        raise

Templates

Two starting points ship with StrataBI:

text artifact. Best for API fetchers, metadata, and light transforms.

dataframe for table and plotly tiles.

Both implement the contract above; drop your logic into the marked section.

Note
For a dataframe tile the app expects result_kind: dataframe, result_format: parquet. The matching status_context values are passed to your Lambda — write to the key you're given rather than choosing your own.