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:
{ "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:
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 writerYour Lambda must:
- Write its result artifact to
s3://{system_bucket}/{result_s3_key}. - Report final status
SUCCEEDED(orFAILED) keyed by
(runtime_tile_key, run_id) — via the status writer Lambda when provided, otherwise directly to the status table.
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))
raiseTemplates
Two starting points ship with StrataBI:
- simple_python — standard runtime only (boto3 + stdlib). Produces a JSON or
text artifact. Best for API fetchers, metadata, and light transforms.
- python_w_deps — pandas + pyarrow via a Lambda layer. Produces a parquet
dataframe for table and plotly tiles.
Both implement the contract above; drop your logic into the marked section.
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.
Shaleio