Type Alias EnqueueArvoEventActionParam<TData, TType, TExtension>

EnqueueArvoEventActionParam<TData, TType, TExtension>: {
    __extensions?: TExtension;
    accesscontrol?: string;
    data: TData;
    dataschema?: string;
    domains?: ("default" | string)[];
    executionunits?: number;
    id?: string;
    redirectto?: string;
    source?: string;
    subject?: 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.

  • Optionaldomains?: ("default" | string)[]

    Processing domains for event routing and orchestration control.

    Domains enable the orchestrator to categorize events into distinct processing buckets, allowing for specialized routing, prioritization, and handling workflows. Events without explicit domains are automatically assigned to the 'default' domain for standard internal processing.

    Multiple domain assignment allows events to participate in parallel processing flows, enabling sophisticated orchestration patterns.

    ['default'] for events without explicit domain assignment

    • Domains are internal routing metadata and are not included in final ArvoEvents
    • Multi-domain events create a single event instance that participates in all specified domains
    • Separate emit calls with different domains generate distinct events with unique identifiers
    // Standard internal service routing
    domains: ['default']

    // External system or human-in-the-loop processing
    domains: ['external']

    // Parallel processing across multiple domains
    domains: ['default', 'analytics', 'audit']
  • 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.

  • Optionalid?: string

    Unique identifier of the event. Must be a non-empty string. If not provided, a UUID will be generated.

    While it's often best to let the system generate this ID, you may provide your own if you need to ensure idempotency or track specific events.

  • 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.

  • Optionalsource?: string

    Identifies the context in which an event happened. Must be a valid URI representing the event producer.

    By default, the actor source name is used. It is recommended to let that be the case. If you choose to override this, please ensure you are aware of the consequences and it is a deliberate decision. Changing this value may affect event tracing and source identification in your system.

  • Optionalsubject?: string

    Identifies the subject of the event. For Arvo, this must be the Process Id.

    By default, it is the actor subject id, and it is recommended to let that be the case. In rare cases, such as sending init events to a different orchestrator, you might need to explicitly provide it. Otherwise, it's best not to use this field directly to maintain consistency in event subject identification.

  • 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.