Defines the structure of stream data used when passing stream messages (transitions)

interface StreamData {
    code?: number;
    data: Record<string, unknown>;
    metadata: {
        aid: string;
        await?: boolean;
        dad?: string;
        gid?: string;
        guid: string;
        jid?: string;
        spn?: string;
        topic?: string;
        trc?: string;
        try?: number;
    };
    policies?: {
        retry?: StreamRetryPolicy;
    };
    stack?: string;
    status?: StreamStatus;
    type?: StreamDataType;
}

Properties

code?: number

HTTP-like status code for the stream, default assumed as 200

data: Record<string, unknown>

Actual data being transmitted as a record of key-value pairs

metadata: {
    aid: string;
    await?: boolean;
    dad?: string;
    gid?: string;
    guid: string;
    jid?: string;
    spn?: string;
    topic?: string;
    trc?: string;
    try?: number;
}

Metadata associated with the stream data

Type declaration

  • aid: string

    Activity ID

  • Optionalawait?: boolean

    Indicates if the message should wait for a response. If explicitly false, the connection is severed immediately upon verifying (and returning) the Job ID.

  • Optionaldad?: string

    Dimensional address indicating the message routing specifics

  • Optionalgid?: string

    Workflow Generational ID (internal GUID)

  • guid: string

    Globally unique identifier for the StreamData message to distinguish retries from new 'reentry/cycles'

  • Optionaljid?: string

    Workflow/job ID

  • Optionalspn?: string

    OpenTelemetry Span identifier

  • Optionaltopic?: string

    Workflow/job topic

  • Optionaltrc?: string

    OpenTelemetry Trace identifier

  • Optionaltry?: number

    Current try count, used for retry logic

policies?: {
    retry?: StreamRetryPolicy;
}

Policies related to retry logic, optional

stack?: string

Error stack trace

status?: StreamStatus

Status of the stream, default assumed as 'success'

Type of the data being streamed, optional