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
  • Basic Node Usage Example
  • Configuring a Range Node
  • When is the Range node useful?

Was this helpful?

  1. Components & Data
  2. Flows
  3. Node Reference
  4. Function

Range

PreviousChangeNextTemplate

Last updated 1 year ago

Was this helpful?

Use a Range node in your Flow to linearly scale a numeric value in one range, to its corresponding value in a separate range that you specify.

Basic Node Usage Example

Configuring a Range Node

To configure a Range node in the , drag it from the Palette to the Workspace canvas, then double-click the node to open and configure its behavior.

  1. Specify the path to the msg. Property that contains the numeric value that you want to scale.

  2. Choose the Action you want to perform

    • Scale the message property: This action linearly scales the input value from the specified input range to the output range without any restrictions or modifications. Values outside the input range are still processed and scaled according to the same ratio.

    • Scale and limit to the target range: This action scales the input value like the first option but adds a limitation such that any scaled value that falls outside the output range is clamped to the nearest boundary of the output range.

    • Scale and wrap within the target range: This action scales the input and then applies wrapping within the output range. If the scaled value exceeds the output range, it wraps around within this range, similar to how a circular buffer works.

    • Scale but drop msg if outside input range: In this action, the input value is scaled only if it falls within the specified input range. If the input value is outside this range, the message is dropped and no output is produced.

  3. Specify the input range by setting a minimum and maximum numeric value.

  4. Specify the target range by settng a minimum and maximum numeric value.

  5. Optionally, choose to round the result to the nearest integer.

  6. Provide an optional Name for the node.

    • By default a Range node will be shown with a label of "n-n" using the target range values that you set for the node, the value you provide will be used instead.

When is the Range node useful?

The Range node is incredibly useful for scaling or translating values from one range to another, adapting data to fit the expected input range of downstream nodes, devices, or systems. Here are some practical purposes and scenarios where such a node can be highly beneficial:

Interfacing with Different Devices

Different devices often require input values within specific ranges. For example, if a sensor outputs a voltage range from 0 to 5 volts, but a motor controller expects a control signal from 0 to 1 volt, a Range node can be used to correctly scale the sensor output to suit the motor controller's input requirements.

Data Normalization

In data processing and machine learning applications, it's common to normalize data to a range that optimizes algorithm performance. For instance, scaling feature values to a range of 0 to 1 can help improve the convergence speed and stability of neural networks.

User Interface Adjustments

When creating user interfaces, such as dashboards for monitoring or controlling devices, input elements like sliders might have a different value range than the actual control parameters of the devices. A Range node can adjust these user inputs to match the required operational parameters of the devices being controlled.

Audio Signal Processing

In audio applications, scaling audio signals to fit within the bounds acceptable to different audio processing units or hardware interfaces is necessary. For instance, mapping a raw microphone input range to a normalized audio processing range can help in maintaining sound quality and reducing noise.

Climate Control Systems

In climate control applications, sensor readings like temperature or humidity often need to be mapped to control ranges for HVAC systems. For example, converting a temperature sensor reading from a Celsius range to a PWM signal range for a fan speed controller ensures that the fan operates correctly based on the current room temperature.

Lighting Systems

In smart lighting systems, light intensity levels might need to be adjusted based on ambient light conditions. A Range node can convert ambient light sensor readings into appropriate dimming levels for lights, enhancing energy efficiency and comfort.

Flow Editor
Example of settings for a Range node
Example of settings for a Range node