PersistentAI API Documentation / @persistentai/fireflow-types / EventNode
Class: EventNode
Defined in: packages/fireflow-types/src/node/templates/event-node.ts:35
EventNode - Template node for .ffevent files
Represents a flow event entry point. Created by the event derivation step when a flow containing EventListenerNodeV2 nodes is saved to VFS.
This is a proper BaseNode subclass that replaces the manual JSON construction in buildCgeventContent(). It stores:
- flowRef: Location of the source flow (workspace, branch, path)
- event: Event definition (name, input schema, output schema)
On drop, the template mapper converts this to an ExecuteFlowNode.
Extends
Constructors
Constructor
new EventNode(
id,_metadata?):EventNode
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:57
Parameters
id
string
_metadata?
Returns
EventNode
Inherited from
Properties
_id
protectedreadonly_id:string
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:42
Inherited from
_metadata
protected_metadata:NodeMetadata
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:43
Inherited from
_status
protected_status:NodeStatus=NodeStatus.Idle
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:44
Inherited from
event
event:
EventSchema
Defined in: packages/fireflow-types/src/node/templates/event-node.ts:50
flowRef
flowRef:
FlowRefPort
Defined in: packages/fireflow-types/src/node/templates/event-node.ts:42
Accessors
id
Get Signature
get id():
string
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:188
Unique identifier of the node
Returns
string
Inherited from
metadata
Get Signature
get metadata():
NodeMetadata
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:192
Metadata describing the node
Returns
Inherited from
ports
Get Signature
get ports():
Map<string,IPort<IPortConfig>>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:251
Get all ports of the node
Returns
Map<string, IPort<IPortConfig>>
Inherited from
status
Get Signature
get status():
NodeStatus
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:196
Current execution status of the node
Returns
Inherited from
Methods
addObjectProperties()
addObjectProperties(
objectPort,properties,useParentUI?):IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:530
Add multiple properties to an object port
Parameters
objectPort
The parent object port
properties
The properties to add
useParentUI?
boolean
Returns
IPort<IPortConfig>[]
The updated object port with the new properties
Inherited from
addObjectProperty()
addObjectProperty(
objectPort,key,portConfig,useParentUI?):IPort
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:526
Add a new property to an object port
Parameters
objectPort
The parent object port
key
string
The property key
portConfig
The port configuration for the new property
useParentUI?
boolean
indicates whether we want to use the parents UI
Returns
Inherited from
appendArrayItem()
appendArrayItem(
arrayPort,value):number
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:546
Add an item to an array port
Parameters
arrayPort
The array port
value
any
The value to append
Returns
number
The index of the new item
Inherited from
bindPortBindings()
bindPortBindings():
void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:515
Bind all port bindings Call this after modifying port structure
Returns
void
Inherited from
bindPortToNodeProperty()
bindPortToNodeProperty(
targetObject,port):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:511
Bind a port to an object property
Parameters
targetObject
any
The object to bind the port to
port
The port to bind
Returns
void
Inherited from
BaseNode.bindPortToNodeProperty
clone()
clone():
INodeComposite
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:629
Create a deep clone of the node
Returns
INodeComposite
A new node instance with the same state
Inherited from
cloneWithNewId()
cloneWithNewId():
this
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:640
Create a deep clone of the node with new unique identifiers This method recursively clones all ports with new IDs while preserving the port hierarchy, values, and metadata
Returns
this
A result object containing the cloned node and ID mappings
Inherited from
commitBatchUpdate()
commitBatchUpdate(
eventContext?):Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:479
Commit all collected port updates and emit events
Parameters
eventContext?
EventContext
Optional context to be added to all emitted events
Returns
Promise<void>
Inherited from
copyObjectSchemaTo()
copyObjectSchemaTo(
sourceNode,sourceObjectPort,targetObjectPort,useParentUI?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:355
Copy the schema of one object port to another This will copy the properties and their configurations and handle all internal ports accordingly
Parameters
sourceNode
IPortManager
sourceObjectPort
ObjectPort<IObjectSchema<Record<string, IPortConfig>>> | AnyPort
targetObjectPort
ObjectPort<IObjectSchema<Record<string, IPortConfig>>> | AnyPort
useParentUI?
boolean
Returns
void
Inherited from
createEvent()
createEvent<
T>(type,data):EventReturnType<T>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:727
Type Parameters
T
T extends NodeEventType
Parameters
type
T
data
Returns
Inherited from
createNestedObjectPorts()
createNestedObjectPorts(
parentPort,objectValue,config,useParentUI?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:369
Create nested object ports for an object value
Parameters
parentPort
The parent port to create the nested ports under
objectValue
any
The object value to create ports for
config
The configuration for the object port
useParentUI?
boolean
indicates whether we want to use the parents UI
Returns
void
Inherited from
BaseNode.createNestedObjectPorts
deserialize()
deserialize(
data):INodeComposite
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:624
Deserialize from JSON data
Parameters
data
unknown
The serialized data
Returns
INodeComposite
The deserialized instance
Inherited from
dispose()
dispose():
Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:239
Release resources and prepare the node for garbage collection
Returns
Promise<void>
Inherited from
emit()
emit<
T>(event):Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:463
Emit an event to all subscribers
Type Parameters
T
T extends NodeEvent
Parameters
event
T
The event to emit
Returns
Promise<void>
Inherited from
execute()
execute(
_context):Promise<NodeExecutionResult>
Defined in: packages/fireflow-types/src/node/templates/event-node.ts:52
Abstract method that must be implemented by concrete nodes We'll wrap this with logic for default port handling
Parameters
_context
Returns
Promise<NodeExecutionResult>
Overrides
executeWithSystemPorts()
executeWithSystemPorts(
context):Promise<NodeExecutionResult>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:160
Runtime execute that wraps the abstract execute to handle system ports. This is an internal method used by the execution engine.
Parameters
context
The execution context
Returns
Promise<NodeExecutionResult>
The execution result
Inherited from
BaseNode.executeWithSystemPorts
findPort()
findPort(
predicate):IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:383
Find a port by a predicate function
Parameters
predicate
(port) => boolean
Predicate function to match the port
Returns
IPort<IPortConfig> | undefined
The port if found, undefined otherwise
Inherited from
findPortByKey()
findPortByKey(
key):IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:459
Find a port by its key
Parameters
key
string
The key of the port to find
Returns
IPort<IPortConfig> | undefined
The port if found, undefined otherwise
Inherited from
findPortByPath()
findPortByPath(
path):IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:290
Find a port by following a path of property names from the node root
Parameters
path
string[]
Path segments (property names or array indices)
Returns
IPort<IPortConfig> | undefined
The port if found, undefined otherwise
Inherited from
findPorts()
findPorts(
predicate):IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:387
Find all ports by a predicate function
Parameters
predicate
(port) => boolean
Predicate function to match the port
Returns
IPort<IPortConfig>[]
Array of ports that match the predicate
Inherited from
getChildPorts()
getChildPorts(
parentPort):IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:294
Get all direct child ports of a parent port
Parameters
parentPort
The parent port
Returns
IPort<IPortConfig>[]
Array of child ports
Inherited from
getDefaultPorts()
getDefaultPorts():
IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:647
Get all default ports based on the node's flow configuration
Returns
IPort<IPortConfig>[]
Inherited from
getErrorMessagePort()
getErrorMessagePort():
IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:671
Get error message port
Returns
IPort<IPortConfig> | undefined
Inherited from
getErrorPort()
getErrorPort():
IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:667
Get error port
Returns
IPort<IPortConfig> | undefined
Inherited from
getFlowInPort()
getFlowInPort():
IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:659
Get flow in port
Returns
IPort<IPortConfig> | undefined
Inherited from
getFlowOutPort()
getFlowOutPort():
IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:663
Get flow out port
Returns
IPort<IPortConfig> | undefined
Inherited from
getInputs()
getInputs():
IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:263
Get all input ports
Returns
IPort<IPortConfig>[]
Array of input ports
Inherited from
getNestedPorts()
getNestedPorts(
parentPort):IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:298
Get all nested ports of a parent port, including its children and their children recursively
Parameters
parentPort
The parent port
Returns
IPort<IPortConfig>[]
Array of all nested ports
Inherited from
getOutputs()
getOutputs():
IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:267
Get all output ports
Returns
IPort<IPortConfig>[]
Array of output ports
Inherited from
getParentshipChain()
getParentshipChain(
port):IPort<IPortConfig>[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:302
Get the full parentship chain of a port, from the port up to the root
Parameters
port
The port to get the chain for
Returns
IPort<IPortConfig>[]
Array of ports in the chain, starting from the given port up to the root
Inherited from
getPort()
getPort(
portId):IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:255
Get a port by its ID
Parameters
portId
string
The port ID
Returns
IPort<IPortConfig> | undefined
The port if found, undefined otherwise
Inherited from
getPortByPath()
getPortByPath(
pathString):IPort<IPortConfig> |undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:391
Get a port by its path string (e.g., "port.subport.array[0].field")
Parameters
pathString
string
The path string to the port
Returns
IPort<IPortConfig> | undefined
The port if found, undefined otherwise
Inherited from
getPortPath()
getPortPath(
portId):string|undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:395
Get the full path string for a given port
Parameters
portId
string
The ID of the port
Returns
string | undefined
The path string (e.g., "port.subport.field") or undefined if port not found
Inherited from
getPortPathForPort()
getPortPathForPort(
port):string
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:399
Get the full path string for a given port instance
Parameters
port
The port instance
Returns
string
The path string (e.g., "port.subport.field")
Inherited from
getRootPort()
getRootPort(
port):IPort
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:306
Get the root port of a given port by traversing up the parentship chain
Parameters
port
The port to find the root for
Returns
The root port
Inherited from
getSystemPortConfigs()
getSystemPortConfigs():
IPortConfig[]
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:651
Get system port configurations
Returns
Inherited from
getUI()
getUI():
NodeUIMetadata|undefined
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:578
Get the node's UI metadata
Returns
NodeUIMetadata | undefined
Node UI metadata or undefined if not set
Inherited from
getVersion()
getVersion():
number
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:605
Get the current version number
Returns
number
The current version
Inherited from
hasPort()
hasPort(
portId):boolean
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:259
Check if a port with the given ID exists
Parameters
portId
string
The port ID
Returns
boolean
True if the port exists, false otherwise
Inherited from
incrementVersion()
incrementVersion():
number
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:601
Increment the node's version number
Returns
number
The new version number
Inherited from
initialize()
initialize(
portsConfig?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:686
Initialize the node with port configurations
Parameters
portsConfig?
Map<string, IPortConfig>
Optional map of port configurations
Returns
void
Inherited from
initializePortsFromConfigs()
initializePortsFromConfigs(
portsConfigs):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:519
Initialize all ports from configs and establish property bindings
Parameters
portsConfigs
Map<string, IPortConfig>
Map of port configurations
Returns
void
Inherited from
BaseNode.initializePortsFromConfigs
isDefaultPort()
isDefaultPort(
portId):boolean
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:655
Check if a port is a system default port
Parameters
portId
string
Returns
boolean
Inherited from
on()
on<
T>(eventType,handler): () =>void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:406
Subscribe to node events of a specific type
Type Parameters
T
T extends NodeEvent
Parameters
eventType
T["type"]
The type of event to subscribe to
handler
(event) => void | Promise<void>
The event handler function
Returns
A function to unsubscribe
():
void
Returns
void
Inherited from
onAll()
onAll(
handler): () =>void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:413
Subscribe to all node events
Parameters
handler
(event) => void | Promise<void>
The event handler function
Returns
A function to unsubscribe
():
void
Returns
void
Inherited from
onEvent()
onEvent(
_event):Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:423
Event handler for the node This is the key method that derived classes can override to handle events
Parameters
_event
The event to handle
Returns
Promise<void>
Inherited from
processPortConfig()
processPortConfig(
config,context):IPortConfig
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:562
Process a port config through the PortConfigProcessor
Parameters
config
context
nodeId
string
parentPortConfig
IPortConfig | null
propertyKey
string
propertyValue
any
Returns
Inherited from
recreateArrayItemPorts()
recreateArrayItemPorts(
arrayPort,newArray):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:571
Helper to recreate array item ports when an array is modified
Parameters
arrayPort
The array port
newArray
any[]
The new array value
Returns
void
Inherited from
BaseNode.recreateArrayItemPorts
refreshAnyPortUnderlyingPorts()
refreshAnyPortUnderlyingPorts(
anyPort,useParentUI?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:558
Creates or deletes child ports depending on whether the child type is an object. This allows child ports to be rendered for objects connected to Any ports
Parameters
anyPort
The Any port
useParentUI?
boolean
indicates whether we want to use the parents UI
Returns
void
Inherited from
BaseNode.refreshAnyPortUnderlyingPorts
removeArrayItem()
removeArrayItem(
arrayPort,index):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:550
Remove an item from an array port
Parameters
arrayPort
The array port
index
number
The index to remove
Returns
void
Inherited from
removeArrayItems()
removeArrayItems(
arrayPort,indices):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:554
Remove multiple items from an array port
Parameters
arrayPort
The array port
indices
number[]
The indices to remove
Returns
void
Inherited from
removeObjectProperties()
removeObjectProperties(
objectPort,keys):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:534
Remove multiple properties from an object port
Parameters
objectPort
The parent object port
keys
string[]
The property keys to remove
Returns
void
Inherited from
BaseNode.removeObjectProperties
removeObjectProperty()
removeObjectProperty(
objectPort,key):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:538
Remove a property from an object port
Parameters
objectPort
The parent object port
key
string
The property key to remove
Returns
void
Inherited from
removePort()
removePort(
portId):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:280
Remove a port by its ID
Parameters
portId
string
The ID of the port to remove
Returns
void
Inherited from
removePorts()
removePorts(
portIds):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:285
Remove multiple ports by their IDs
Parameters
portIds
string[]
Array of port IDs to remove
Returns
void
Inherited from
reset()
reset():
Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:231
Reset the node to its initial state
Returns
Promise<void>
Inherited from
serialize()
serialize():
unknown
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:620
Serialize the node to a JSON-compatible format
Returns
unknown
The serialized node
Inherited from
setComplexPortHandler()
setComplexPortHandler(
handler):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:507
Set the complex port handler (to avoid circular dependencies)
Parameters
handler
IComplexPortHandler
Returns
void
Inherited from
BaseNode.setComplexPortHandler
setDimensions()
setDimensions(
dimensions,emitEvent?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:590
Update the node's dimensions
Parameters
dimensions
New dimensions
emitEvent?
boolean
Whether to emit a dimensions change event
Returns
void
Inherited from
setMetadata()
setMetadata(
metadata):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:200
Set the node metadata
Parameters
metadata
New metadata
Returns
void
Inherited from
setNodeParent()
setNodeParent(
position,parentNodeId?,emitEvent?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:594
Update the node's parent and position
Parameters
position
New position coordinates
parentNodeId?
string
ID of the parent node or undefined to remove parent
emitEvent?
boolean
Whether to emit a parent change event
Returns
void
Inherited from
setPort()
setPort(
port):IPort
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:271
Add or update a port
Parameters
port
The port to set
Returns
The added/updated port
Inherited from
setPorts()
setPorts(
ports):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:275
Set all ports at once
Parameters
ports
Map<string, IPort<IPortConfig>>
Map of ports to set
Returns
void
Inherited from
setPosition()
setPosition(
position,emitEvent?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:586
Update the node's position
Parameters
position
New position coordinates
emitEvent?
boolean
Whether to emit a position change event
Returns
void
Inherited from
setStatus()
setStatus(
status,emitEvent?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:212
Set the node status
Parameters
status
New status
emitEvent?
boolean
Whether to emit a status change event
Returns
void
Inherited from
setUI()
setUI(
ui,emitEvent?):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:582
Update the node's UI metadata
Parameters
ui
New UI metadata
emitEvent?
boolean
Whether to emit a UI change event
Returns
void
Inherited from
setVersion()
setVersion(
version):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:613
Set the node version
Parameters
version
number
The new version
Returns
void
Inherited from
shouldExecute()
shouldExecute(
context):boolean
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:675
Determine if node should execute based on flow ports
Parameters
context
Returns
boolean
Inherited from
startBatchUpdate()
startBatchUpdate():
void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:471
Start collecting port updates without emitting events immediately Used for batch operations where multiple ports are updated
Returns
void
Inherited from
updateArrayItemConfig()
updateArrayItemConfig(
arrayPort):void
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:542
Updates the items with the new array ports item configuration
Parameters
arrayPort
The array port
Returns
void
Inherited from
BaseNode.updateArrayItemConfig
updatePort()
updatePort(
port,eventContext?):Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:316
Update a port and emit a port update event This is a critical method that triggers port-related events
Parameters
port
The port to update
eventContext?
EventContext
Optional event context for additional metadata
Returns
Promise<void>
Inherited from
updatePorts()
updatePorts(
ports,eventContext?):Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:326
Update multiple ports at once This is useful for batch updates
Parameters
ports
IPort<IPortConfig>[]
Array of ports to update
eventContext?
EventContext
Optional event context for additional metadata
Returns
Promise<void>
Inherited from
updatePortsAfterExecution()
updatePortsAfterExecution(
success,errorMessage?):Promise<void>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:679
Update flow ports after execution
Parameters
success
boolean
errorMessage?
string
Returns
Promise<void>
Inherited from
BaseNode.updatePortsAfterExecution
validate()
validate():
Promise<NodeValidationResult>
Defined in: packages/fireflow-types/src/node/base-node-compositional.ts:226
Validate the node configuration
Returns
Promise<NodeValidationResult>
A promise resolving to the validation result