LogoLogo
Visit Contextual.ioSign Up
  • Getting Started
    • Welcome
    • Tour: Hello, AI World!
  • TRAINING
    • Basic Developer Training Course
      • Lesson 1: HTTP Agent Introduction
      • Lesson 2: Logging and Error Handling Basics
      • Lesson 3: Event Processing Agent Introduction
  • Services Catalog
    • What's in the Catalog?
      • Intro Patterns
      • Object Type Bundles
    • Browse by Platform
    • All Intro Patterns
      • Anthropic Claude Image Analysis
      • Mistral AI Prompt and Response
      • xAI Grok Prompt and Response
      • DeepSeek Chat Prompt and Response
      • Qwen Chat Prompt and Response
      • Perplexity AI Search and Response
      • Firecrawl Website Scraper
      • Groq Prompt and Response
      • Nyckel Dog Breed Classification
      • RapidAPI ClassifyAI Text Classification
      • RapidAPI YouTube AI Video Summary
      • UnifyAI Model Comparison
      • WebPilot URL Analysis and Summarization
      • OpenAI Assistants Prompt and Response
      • OpenAI Sync
    • All Prebuilt Solutions
      • Invoice AI
      • Lead Generation Form
    • All Object Type Bundles
      • Work Order Management System ITIL Object Type Bundle
        • Work Order
        • User
        • Role
        • Permission
        • Asset
        • Task
        • Action
        • Attachment
        • Comment
        • Notification
        • Audit Log
        • Service Level Agreement
        • Custom Fields
        • Work Order Template
        • Work Order Transition
        • Escalation Policy
        • Tag
  • Components & Data
    • Object Types
      • Data in Contextual
        • Secrets
        • Validation
        • Versioning
      • Examples
      • Creating an Object Type
      • Object Type Details
        • Definition
        • Data Schema
          • Automatic Record Metadata
          • Generated Values
            • Dates and Times
            • UUIDs
          • Frequently Used Validation
          • Disallowing Null Property Values
          • Disallowing Undefined Properties
          • Secrets
          • AI Assistant
          • ID and PrimaryKey Permanence
        • UI Schemas
        • Features
        • Triggers
        • Actions
        • Audit Trail
        • Versions
        • Templates
        • Records
      • Using Object Types in Flows
      • Records
        • Records and Your Tenant API
        • Record Import
    • Flows
      • Nodes
      • Wires
      • Message Object
      • Flow Editor
        • Basics
        • Saving Changes
        • In-Flow Testing with Debugger
        • Restart Agents to Make Changes Active
        • Config
      • Node Reference
        • Common
          • Log Tap
          • Inject
          • Debug
          • Complete
          • Catch
          • Status
          • Link In
          • Link Call
          • Link Out
          • Comment
        • Event
          • Prepare Event
          • Event Start
          • Event End
          • Event Error
        • Object
          • Search Object
          • Get Object
          • Create Object
          • Patch Object
          • Put Object
          • Delete Object
          • Run Action
        • Request
          • Send to Agent
          • HTTP GET
          • HTTP PATCH
          • HTTP PUT
          • HTTP DELETE
          • HTTP POST
          • GQL
          • Produce Message
        • Function
          • Function
          • Switch
          • Change
          • Range
          • Template
          • Delay
          • Trigger
          • Exec
          • Filter
          • Loop
        • Models
          • ML Predict
        • Network
          • MQTT In
          • MQTT Out
          • HTTP In
          • HTTP Response
          • HTTP Request
          • WebSocket In
          • WebSocket Out
          • TCP In
          • TCP Out
          • TCP Request
          • UDP In
          • UDP Out
        • Sequence
          • Split
          • Join
          • Sort
          • Batch
        • Parser
          • csv
          • html
          • json
          • xml
          • yaml
    • Agents
      • Creating an Agent
      • Types of Agents
        • Event to Flow
        • HTTP to Flow
          • Custom Domains
      • How Agents Work
        • Flow Execution
        • HTTP Load Balancing
        • Event Routing
      • Scale and Performance
        • Flow execution
        • Parallel Instances
        • Event Lag Scaling
        • Compute Threshold Scaling
        • Instance Compute Sizing
      • Agent Details
        • Definition
        • Operations
        • Logs
          • Session Log
          • Message Log
        • Audit Trail
        • Versions
      • Using Agents in Flows
    • Connections
      • Creating a Connection
      • Types of Connections
        • Basic
        • Bearer
        • Client Grant
        • Kafka
        • Password Grant
        • Public
        • Pulsar
      • Using Connections in Flows
    • JWKS Profiles
      • Using JWKS Profiles in Your Solution
  • PATTERNS
    • Solution Architecture
      • Events, Messages, Queues
    • Working with Data
      • Search Object Node & Pagination
      • Message Payload Content - Triggers and Actions
    • Industry Cookbooks
      • Field Services
  • Tenants
    • Tenant Workspace
    • Tenant Logs
      • Contextual Log Query Language (CLQL)
        • String Searches
        • Keyword Searches
        • Advanced Operators
    • Tenant API
      • API Keys
        • API Key Settings
        • API Key Permissions
      • Documentation
  • Release Notes
    • 2024
      • 2024.12.09
Powered by GitBook
On this page

Was this helpful?

  1. Components & Data
  2. Flows

Message Object

PreviousWiresNextFlow Editor

Last updated 12 months ago

Was this helpful?

What is the Message Object?

In a Contextual Flow, the Message Object is a versatile container that holds all data and properties being processed, as they traverse through a flow.

  • Read: Nodes can access the current properties of the message object, such as msg.payload.

  • Modify: Nodes can change the contents of the message object.

  • Extend: Nodes can add new properties to the message object, enriching the data structure.

Typically starting with an msg.payload property, which contains the primary data from an input node, the message object can be enriched with additional properties such as msg.topic, msg.myCustomProperty, or any other custom attributes as needed. This flexibility allows for the creation of dynamic and responsive flows, where the message object evolves in real-time, carrying with it all the necessary information required by subsequent nodes. The comprehensive structure of the message object is key to the powerful and modular nature of software built using Contextual.

Where does the content of the Message Object come from?

The content of the message object is determined by the source of the data being sent to the flow, so varies widely. In Contextual, it is common for the message object to contain...

  • JSON with all details from a create, update, delete, or other action for a of an

  • JSON with the formatted output of a...

Movement of the Message Object in a Flow

  1. Starts at an Input Node: The journey of the message object begins at an input node, such as an Event Start, HTTP In node, or any other input source. This node receives data and creates a message object, typically containing a payload property (msg.payload) with the initial data.

  2. Travels Through Processing Nodes: The message object moves along the wires in the flow to various processing nodes. Each node can read, modify, or extend the properties of the message object.

    • Example: A function node can add a timestamp to the message object by including a line like msg.timestamp = Date.now();.

  3. Conditional Routing and Transformation: Nodes like switch nodes or change nodes can conditionally route or transform the message object.

    • Example: A switch node might route messages to different outputs based on the value of msg.payload.severity.

  4. Extending the Message Object: Nodes can add new properties to the message object beyond msg.payload. This allows for a richer and more complex data structure to be built as the message progresses through the flow.

    • Example: An HTTP Post node might interact with an external system using an API call, and add the resulting response to a new msg.apiResponse property.

  5. End at an Output Node: Finally, the message object reaches an output node, such as an HTTP Response node, MQTT Out node, or a database node. This node sends the modified message object to an external system.

Record
Object Type