When to Use Action Models
Action models (COLLAPSED models) are templates for structured data that you publish explicitly from within actions. They’re ideal when you need:- Control over timing - Publish only when specific conditions are met
- Dynamic routing - Send data to different topics based on logic
- Data transformation - Process and enrich data before structuring
Example Use Case
Imagine you receive raw alarm data and need to:- Extract relevant fields from JSON
- Add a unique ID and timestamp
- Route critical alarms to a special topic
- Publish a structured record
Step-by-Step Guide
1
Define a COLLAPSED Model
Create a template with all required fields. The
COLLAPSED keyword indicates this model has no automatic trigger:2
Create the Processing Action
Define an action that extracts data and publishes the model:
3
Test the Flow
Publish to: Result at:
sensors/temp001/json_datasensors/processed/temp001Use Case Examples
- Alarm Processing
- Quality Reports
- Event Logging
Route alarms by severity while creating structured records:
Best Practices
Always Use Type Casting with GET JSON
Always Use Type Casting with GET JSON
Explicit type casting prevents runtime errors:
Validate Extracted Data
Validate Extracted Data
Check data before publishing:
Use Dynamic Topics
Use Dynamic Topics
Include identifiers in output topics for easy filtering:
Generate Unique IDs
Generate Unique IDs
Use
RANDOM UUID for record identification:Next Steps
Model Examples
See complete examples for common use cases.
Action Operations
Review available operations for action logic.

