Record Event
Record a process event with one or more associated objects. Events are the core building blocks of process mining — they represent activities that happen to objects in your business process.
Request Body
- Name
event- Type
- string
- Required
- required
- Description
- The name of the event (1-200 characters). Examples: "Order Placed", "Invoice Sent", "Case Closed"
- Name
objects- Type
- array
- Required
- required
- Description
- Array of objects involved in this event. Each object must have a
typeandid. Objects link events together in the process graph.
- Name
timestamp- Type
- string
- Description
- ISO 8601 timestamp for when the event occurred. Defaults to the current server time if not provided. Use this for historical data imports.
- Name
properties- Type
- object
- Description
- Optional event-specific attributes. Can contain any JSON-serializable data like amounts, counts, or metadata.
Object Schema
- Name
type- Type
- string
- Required
- required
- Description
- The object type (1-100 characters). Examples: "Order", "Customer", "Ticket"
- Name
id- Type
- string
- Required
- required
- Description
- Unique identifier within the type (1-500 characters). Examples: "ORD-123", "CUST-456"
- Name
properties- Type
- object
- Description
- Optional object properties. Merged with existing properties if the object already exists.
- Name
qualifier- Type
- string
- Description
- Describes the object's role in this event (1-100 characters). Examples: "initiator", "target", "performer", "payer"
Request
curl -X POST 'https://api.flowmyna.com/api/public/v1/event' \
-H 'Authorization: Bearer fm_live_xxx' \
-H 'Content-Type: application/json' \
-d '{
"event": "Order Placed",
"timestamp": "2024-01-15T10:30:00Z",
"objects": [
{
"type": "Order",
"id": "ORD-123",
"properties": {
"total": 149.99,
"currency": "USD"
}
},
{
"type": "Customer",
"id": "CUST-456"
}
],
"properties": {
"channel": "web",
"items_count": 3
}
}'Response
{
"success": true,
"event_id": "550e8400-e29b-41d4-a716-446655440000",
"event_type": "Order Placed",
"timestamp": "2024-01-15T10:30:00Z",
"objects_count": 2,
"message": "Event 'Order Placed' recorded successfully"
}Multi-Object Events
Events often involve multiple objects. When you include multiple objects in an event, Flow Myna creates links between them in the process graph. This is essential for analyzing how different entities interact in your business process.
Multi-Object Event Example
{
"event": "Order Shipped",
"objects": [
{"type": "Order", "id": "ORD-123"},
{"type": "Shipment", "id": "SHIP-456"},
{"type": "Carrier", "id": "FEDEX"},
{"type": "Warehouse", "id": "WH-EAST"}
],
"properties": {
"tracking_number": "1234567890",
"shipping_method": "express"
}
}This creates a graph where Order ORD-123, Shipment SHIP-456, Carrier FEDEX, and Warehouse WH-EAST are all connected through the "Order Shipped" event.
Object Qualifiers
Use qualifiers to describe each object's role in an event. This enables richer semantic modeling and more expressive process analysis — for example, distinguishing between the payer and recipient in a payment event.
Event with Qualifiers
{
"event": "Payment Processed",
"objects": [
{"type": "Order", "id": "ORD-123", "qualifier": "target"},
{"type": "Customer", "id": "CUST-456", "qualifier": "payer"},
{"type": "PaymentMethod", "id": "CC-789", "qualifier": "instrument"}
],
"properties": {
"amount": 149.99,
"currency": "USD"
}
}Common qualifier values include:
initiator— The entity that triggered the eventtarget— The primary object being acted uponperformer— The agent executing the actionpayer/recipient— For financial transactionssender/receiver— For communication events
Qualifiers are optional. If not specified, the object is still linked to the event without a specific role annotation.
Historical Data Import
When importing historical data, always include the timestamp field. Events will be properly ordered in process analysis regardless of when they're sent to the API.
Historical Event
{
"event": "Invoice Sent",
"timestamp": "2023-06-15T14:30:00Z",
"objects": [
{"type": "Invoice", "id": "INV-2023-001"}
]
}Timestamps must be valid ISO 8601 format. Examples: 2024-01-15T10:30:00Z or 2024-01-15T10:30:00+02:00
Auto-Creation Behavior
The event endpoint automatically creates missing resources:
- Event Types — If "Order Placed" doesn't exist, it's created automatically
- Object Types — If "Order" type doesn't exist, it's created
- Objects — If object "ORD-123" doesn't exist, it's created
All auto-created types are marked with {"source": "public_api"} metadata.
SDK Examples
Record Events with SDKs
from flowmyna import FlowMyna
client = FlowMyna(api_key="fm_live_xxx")
# Simple event
client.record_event(
event="Order Placed",
objects=[{"type": "Order", "id": "ORD-123"}]
)
# Event with full options
client.record_event(
event="Order Shipped",
timestamp="2024-01-15T10:30:00Z",
objects=[
{"type": "Order", "id": "ORD-123", "properties": {"total": 149.99}},
{"type": "Shipment", "id": "SHIP-456"}
],
properties={"tracking_number": "1234567890"}
)