sym.sdk.event

Triggers for the various steps of a Flow.

Classes

Event

The Event class contains information on an event which has been received by Sym, routed to a Run of a Flow, and is triggering specific user-defined Handlers.

EventMeta

Contains metadata about an Event instance.

Payload

The Payload object contains the data of the Event.

class sym.sdk.event.Event

The Event class contains information on an event which has been received by Sym, routed to a Run of a Flow, and is triggering specific user-defined Handlers.

Each Handler will be invoked with a single argument, which is an instance of this class. This Event instance will describe the current execution state, and can be used to dynamically alter the behavior and control flow of Templates.

Read more about Handlers.

property actors

A dict mapping Event names to the User that created each Event. There will be one entry for each Event in the current Run.

For example, with a sym:approval Flow after the “approve” Event is received, the actors may look like this:

{
    "prompt": <User A>,
    "request": <User A>,
    "approve": <User B>
}
property fields

A dict containing the values submitted by the user who created the Event.

property flow

A Flow object, indicating the Flow that the current Run is an instance of.

property meta

An EventMeta object, which contains metadata about the Event instance.

property name

The name of the Event.

property payload

A Payload object, which contains the primary data of the Event.

property run

A Run object, indicating the current Run.

property template

A Template object, indicating which Template the current Flow inherits from.

property user

The User who triggered the Event.

class sym.sdk.event.EventMeta(srn: Union[sym.sdk.resource.SRN, str])

Bases: sym.sdk.resource.SymResource

Contains metadata about an Event instance.

property srn

A SRN object that represents the unique identifier for this resource.

class sym.sdk.event.Payload(srn: Union[sym.sdk.resource.SRN, str])

Bases: sym.sdk.resource.SymResource

The Payload object contains the data of the Event.

property actors

A dict mapping Event names to the User that created each Event. There will be one entry for each Event in the current Run.

For example, with a sym:approval Flow after the “approve” Event is received, the actors may look like this:

{
    "prompt": <User A>,
    "request": <User A>,
    "approve": <User B>
}
property event_name

Returns the name of the Event.

For example, “approve”.

property fields

A dict containing the values submitted by the user who created the Event

property srn

The SRN of the Event instance.

property timestamp

A datetime object indicating when the Event was created.

property user

The User who triggered the Event.