Type Alias EnqueueArvoEventActionParam<TData, TType, TExtension>

EnqueueArvoEventActionParam<TData, TType, TExtension>: {
    __extensions?: TExtension;
    accesscontrol?: string;
    data: TData;
    dataschema?: string;
    domain?: (string | null)[];
    executionunits?: number;
    redirectto?: string;
    to?: string;
    type: TType;
}

Represents the parameters for the emitArvoEvent action in ArvoXState. This type defines a subset of properties from the CreateArvoEvent type, specifically tailored for emitting an ArvoEvent within the state machine context.

Type Parameters

  • TData extends ArvoEventData = ArvoEventData
  • TType extends string = string
  • TExtension extends CloudEventExtension = CloudEventExtension

Type declaration

  • Optional__extensions?: TExtension

    Custom extensions for the CloudEvent. Allows for additional metadata to be attached to the event.

    Use this field to include any non-standard attributes that are not covered by the core CloudEvent specification or Arvo extensions.

  • Optionalaccesscontrol?: string

    Defines access controls for the event. Can be a UserID, encrypted string, or key-value pairs.

    This field is used to implement fine-grained access control on event consumption. The exact format and interpretation may depend on your system's access control mechanisms.

  • data: TData

    The event payload. This payload must be JSON serializable.

    The data field contains the event-specific information. Ensure that the structure of this data conforms to the schema specified in the dataschema field, if provided.

  • Optionaldataschema?: string

    Identifies the schema that the data adheres to. Must be a valid URI if present.

    Use this field to provide a link to the schema definition for the event data. This helps consumers understand and validate the event structure.

  • Optionaldomain?: (string | null)[]

    The domain configuration for multi-domain event broadcasting.

    When an event is emitted with a domain array, Arvo generates a separate ArvoEvent for each resolved domain value. This enables parallel routing to multiple contexts such as analytics, auditing, human-in-the-loop systems, or external integrations.

    Accepted Values:

    • A concrete domain string (e.g. 'audit.orders')
    • null for standard internal routing (no domain)
    • A symbolic value from ArvoDomain.

    Broadcasting Rules:

    • Each resolved domain in the array creates a separate ArvoEvent instance
    • Duplicate resolved domains are automatically removed
    • If the field is omitted, Arvo defaults to [null]

    Examples:

    • ['analytics.orders', 'audit.orders'] → Creates two routed events
    • [ArvoDomain.FROM_TRIGGERING_EVENT, 'human.review', null] → Mirrors source domain, routes to review, and standard consumer
    • [null] → Emits a single event with no domain routing
    • Omitted → Same as [null]
  • Optionalexecutionunits?: number

    Represents the cost associated with generating the cloudevent.

    By default, it uses the actor's executionunits. This field can be used for resource accounting or billing purposes. Only override this if you have a specific reason to assign a different cost to this particular event emission.

  • Optionalredirectto?: string

    Indicates alternative recipients or destinations for events. Must be a valid URI if present.

    Use this field to implement event forwarding or to specify secondary event consumers in addition to the primary one specified in the to field.

  • Optionalto?: string

    Defines the consumer machine of the event. Used for event routing. Must be a valid URI if present. If not available, the type field is used as a default.

    This field is crucial for directing events to specific services or components in your system. Ensure the URI is correctly formatted and recognized by your event routing infrastructure.

  • type: TType

    Describes the type of event. Should be prefixed with a reverse-DNS name.

    The event type is a key field for consumers to understand the nature of the event without inspecting its data. Use a consistent naming convention to enhance system-wide event comprehension.

The EmitArvoEventActionParam type is crucial for maintaining consistency and type safety when emitting events in an ArvoXState machine. It ensures that only relevant properties are included and properly typed.