Nected Docs
Try Nected For Free
  • 5 min QuickStart Guide
  • Getting Started
    • Introduction
    • Core Concepts
    • Use Cases
    • Tech Architecture
    • FAQs
  • INTEGRATIONS
    • Overview
    • Integrations Libraries
      • PostGres
      • MySQL
      • Oracle
      • MS SQL Server
      • Snowflake
      • MongoDB
      • RedShift
      • REST API
      • Google Sheets
      • Slack
    • Managing Integrations
  • DATASETS
    • Overview
    • Managing Dataset
  • Rules
    • Overview
    • Rule Types
      • SimpleRule
      • DecisionTable
      • Ruleset
      • Rule Chain
    • Rule Conditions
    • Rule Actions
    • Concepts
      • Rule Result
      • Test & Publish Rules
    • Add Input Attributes
      • JSON Input Attributes
      • List Input Attributes
  • Triggers
    • Trigger Rule via API
    • Trigger Rule via WebHook
    • Trigger Workflow via API
    • Trigger Workflow via WebHook
    • Scheduler
    • Response Format
  • Workflow
    • Overview
    • Managing Workflow
    • Add Node
      • Action Nodes
        • Rule Node
        • Workflow Node
        • Custom Code Node
        • Database Node
        • REST API Node
      • Control Nodes
        • Loop Node
        • Delay Node
        • Response Node
        • Set Variables Node
        • Switch Block
    • Test & Publish Workflows
  • CODE AND DATABASE QUERIES
    • JavaScript Editor
    • Formula Editor
    • JSON Editor
    • List Editor
    • Excel-like Function
  • Embedded System
    • White-Labelling
    • Embeddable View
  • Self Hosting
    • Overview
    • Infrastructure Sizing
    • New Installation
      • Docker
      • Kubernetes
        • Set Up Kubernetes Cluster on AWS EKS
    • Additional Configuration
      • High Availability
      • Email Setup Guide
    • Upgrade Nected Version
  • Security
    • API Authentication
      • OAuth as part of Authentication under REST API
    • Role Based Access Control (RBAC)
    • SOC 2 Type 2, GDPR, ISO Compliance
  • Audit
    • Audit Trail
    • Approval Flow
    • Version Control & Rollback
    • Import/Export
  • Management API
    • Audit Log API
    • Global Variable API
  • References
    • Attribute Library
    • Global Variables
    • Pre-Configured Tokens
    • Pre-Configured Operators
    • NULL Value Handling/Behavior
    • Troubleshooting Errors
      • Multiple Tabs/Users Edits
      • Limits in Nected
    • Allowed Status Combinations
    • Environments
    • Usage Widget
    • Gen AI
  • ACCOUNT SETTINGS
    • Workspace Setting
      • Date Format and Timezone Settings
Powered by GitBook
On this page
  • Rule Response Content Type
  • Workflow Response Content Type
  1. Triggers

Response Format

Rule Response Content Type

By default, when triggering a rule—whether it's a SimpleRule, DecisionTable, or Ruleset—via API, the response is returned in JSON format. This is the standard for the Test Result tabs inside the Nected platform, where rule responses are displayed as formatted JSON for easy inspection and debugging.

However, when rules are called via API (either from an external system or another Nected rule/workflow), the response format and input format can both be fully controlled using standard HTTP headers:

Set Response Format Using Accept Header

To receive the rule response in a format other than JSON, set the Accept header in your API call accordingly:

Format
Accept Header

JSON

application/json (default)

XML

application/xml

HTML

text/html

Text

text/plain

FORM

multipart/form-data

FORM URL Encoded

application/x-www-form-urlencoded

Example for XML Response:

curl -X POST "<https://nected-59.nected.io/nected/rule/><rule_id>" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/xml" \\
  -d '{
    "environment": "production",
    "params": {
      "user_id": 12345
    },
    "version": "1.0"
}'

This will return the same rule response structure in XML format, for example:

<response>
  <code>success</code>
  <message>Success</message>
  <data>
    <executionId>ruleLive:...</executionId>
    <executionTime>42ms</executionTime>
    <output>
      <score>92</score>
      <recommendation>accept</recommendation>
    </output>
    <ruleId>abc-123</ruleId>
  </data>
</response>

Set Input Format Using Content-Type Header

Similarly, rule input can be submitted in alternative formats (e.g., XML or form-encoded), as long as the correct Content-Type header is set in the request. Internally, Nected will parse the request based on this type and evaluate it as intended.

Format
Accept Header

JSON

application/json (default)

XML

application/xml

HTML

text/html

Text

text/plain

FORM

multipart/form-data

FORM URL Encoded

application/x-www-form-urlencoded

Example for XML Input Payload:

<root>
  <environment>production</environment>
  <params>
    <user_id>12345</user_id>
  </params>
  <version>1.0</version>
</root>

Sent via:

curl -X POST "<https://nected-59.nected.io/nected/rule/><rule_id>" \\
  -H "Content-Type: application/xml" \\
  -H "Accept: application/xml" \\
--data ' <root>
     <environment>staging</environment> // or production
     <params>
     ...// all params
     </params>
 </root>'

Nected will parse this XML input, process the rule logic, and return the response in the requested format (e.g., XML).

<aside> ⚙

Even though you can set custom content types for input and output in live API calls, the Test Result tabs in Nected (for rules, workflows, or connectors) always render results in JSON for consistent visual formatting. However, this does not affect the actual runtime behavior of your API calls.

</aside>

Use the Accept and Content-Type headers to handle XML, plain text, or other formats externally when integrating with legacy systems, ERP platforms, or custom frontends.


Workflow Response Content Type

By default, when invoking a workflow via API, Nected returns the output in JSON format. This format is displayed in the Test Result tab within the platform to ensure consistent and clear output visualization during testing.

However, you can customize both the response format and input format when executing a workflow externally (from another system or service) by specifying standard HTTP headers.

Set Workflow Response Format Using Accept Header

To receive the workflow execution result in a specific format, you can set the Accept header in your API request. This allows seamless integration with systems that require XML, plain text, or other response formats.

Format
Accept Header

JSON

application/json (default)

XML

application/xml

HTML

text/html

Text

text/plain

FORM

multipart/form-data

FORM URL Encoded

application/x-www-form-urlencoded

Example API Call for XML Response:

curl -X POST "<https://nected-59.nected.io/nected/workflow/><workflow_id>" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/xml" \\
  -d '{
    "environment": "production",
    "params": {
      "cart": {
        "userId": 101,
        "email": "alice@example.com",
        "cart_list": [...]
      }
    },
    "version": "1.0"
}'

Sample XML Response:

<response>
  <code>success</code>
  <message>Success</message>
  <data>
    <executionId>workflowLive:60:workflow_id:1.0:uuid</executionId>
    <executionTime>85ms</executionTime>
    <output>
      <recommendation>bundle_offer_2</recommendation>
      <cart_score>92</cart_score>
    </output>
    <workflowId>workflow_id</workflowId>
    <version>1.0</version>
    <name>Cart Analysis</name>
  </data>
</response>

Set Workflow Input Format Using Content-Type Header

Just like with rule execution, you can post input in formats other than JSON, such as XML or form-encoded strings, by setting the Content-Type header accordingly.

Format
Accept Header

JSON

application/json (default)

XML

application/xml

HTML

text/html

Text

text/plain

FORM

multipart/form-data

FORM URL Encoded

application/x-www-form-urlencoded

Example XML Input:

<root>
  <environment>production</environment>
  <params>
    <cart>
      <userId>101</userId>
      <email>alice@example.com</email>
      <cart_list>...</cart_list>
    </cart>
  </params>
  <version>1.0</version>
</root>

Sent via:

curl --location '<https://nected-59.nected.io/nected/workflow/c2971bbf-18a1-4a87-b0fe-d2c426d063d8>' \\
--header 'Accept: application/x-www-form-urlencoded' \\
--header 'Content-Type: application/xml' \\
--data ' <root>
     <environment>staging</environment> // or production
     <params>
     ...// all params
     </params>
 </root>'

Use Accept and Content-Type headers as needed to ensure your workflows can interact seamlessly with systems requiring specific input or response formats, such as enterprise backends, legacy software, or third-party API consumers.

PreviousSchedulerNextOverview

Last updated 1 day ago