Skip to content

Executions Module

SDK reference for querying workflow execution history and live logs

The executions module lets workflows query historical executions and stream their own in-flight logs. Platform admins see all executions in their scope; regular users see only their own.

from bifrost import executions
MethodReturnsDescription
executions.list()list[WorkflowExecution]List executions with optional filters
executions.get()WorkflowExecutionGet a single execution by ID
executions.get_current_logs()list[ExecutionLog]Read logs from the current (or specified) execution’s Redis stream
async def list(
workflow_name: str | None = None,
status: str | None = None,
start_date: str | None = None,
end_date: str | None = None,
limit: int = 50,
) -> list[WorkflowExecution]
ParameterTypeDescription
workflow_namestr | NoneFilter by workflow name
statusstr | NoneFilter by status (e.g. "Failed", "Completed")
start_datestr | NoneISO-format lower bound on started_at
end_datestr | NoneISO-format upper bound on started_at
limitintMax results (default 50, capped at 1000)
recent = await executions.list(limit=10)
failed_today = await executions.list(status="Failed", start_date="2026-04-25")
async def get(execution_id: str) -> WorkflowExecution

Raises ValueError if not found, PermissionError if access is denied.

detail = await executions.get("a1b2c3d4-...")
print(detail.status, detail.duration_ms)

Read structured log entries from the Redis stream for an execution. Useful for in-flight progress checks, sub-workflow context passing, or post-mortem inspection.

async def get_current_logs(
execution_id: str | None = None,
start: str = "0",
count: int = 100,
) -> list[ExecutionLog]
ParameterTypeDescription
execution_idstr | NoneDefaults to the current execution ID from context
startstrStream ID to start at ("0" = beginning)
countintMax entries to read

When called outside a workflow context with no execution_id, raises RuntimeError.

logs = await executions.get_current_logs()
for entry in logs:
print(f"[{entry.level}] {entry.message}")
FieldTypeDescription
execution_idstrUnique execution ID
workflow_namestrWorkflow name
org_idstr | NoneOrganization ID
form_idstr | NoneForm ID if triggered via form
executed_bystrUser ID who executed
executed_by_namestrDisplay name
statusstrCurrent status
input_datadictInput parameters
resultAnyExecution result
result_typestr | NoneHint for rendering result
error_messagestr | NoneError if failed
duration_msint | NoneTotal duration
started_at, completed_atdatetime | NoneTimestamps
logslist[dict] | NoneCaptured log entries
variablesdict | NoneRuntime variables
session_idstr | NoneCLI session ID
peak_memory_bytes, cpu_total_secondsresource metrics
FieldTypeDescription
idstrStream entry ID
execution_idstrExecution UUID
levelstr"INFO", "WARNING", "ERROR", "DEBUG", "CRITICAL"
messagestrLog message
metadatadict | NoneOptional JSON metadata
timestampstrISO timestamp