Test API for Bulk Inputs

Bulk testing your Nected rules and workflows validates their performance and accuracy across multiple scenarios simultaneously. You can efficiently manage large datasets from sources like Google Sheets, databases, or CSV files. This guide demonstrates two robust methods for bulk testing:

  • Method 1: Using Postman's Collection Runner

  • Method 2: Using Nected's built-in Loop Node

Prerequisites

Ensure you have:

  • Access to the Nected platform.

  • Valid Rule or Workflow endpoint URL.

  • Structured test data (Google Sheets, CSV file, or database).

  • Postman (for Method 1).

  • Nected Workflow Editor access (for Method 2).

Method 1: With Postman Collection Runner

1

Prepare Your Test Data

Create a CSV file with your test scenarios:

  • Column headers should exactly match your API parameters.

  • Boolean values must be lowercase (true, false).

  • Optionally include columns for expected results to facilitate verification.

2

Set Up Postman Request

  1. Open Postman and create a new collection and request.

  2. Set the request method to POST.

  3. Enter your Nected rule/workflow endpoint URL:

    <https://nected-XX.nected.io/nected/rule/XXXX>
  4. Configure the request body using CSV column variables as follows:

    {
      "environment": "staging",
      "params": {
        "basekindlePrice": {{basekindlePrice}},
        "countrycode": "{{countrycode}}",
        "customerTier": "{{customerTier}}",
        "inventoryLevel": "{{inventoryLevel}}",
        "isBlackFriday": {{isBlackFriday}}
      }
    }
    
3

Run Bulk Tests

  1. Select your collection and click Run to open the Collection Runner.

  2. Upload your CSV file via Select File.

  3. Set the iterations count equal to the number of data rows.

  4. Choose a delay between requests (use 0 ms for rapid testing).

  5. Click Run [Collection Name] to start testing.

4

Analyze Results

  • Each row executes independently, displaying individual pass/fail results.

  • Export the execution results to analyze test outcomes further.

  • Review detailed response information for debugging.

Method 2: Using Nected’s Loop Node

Using Nected’s Loop Node provides an automated, native approach for bulk validation, ideal for repeated testing scenarios.

By the way, this method can also be used for bulk testing external APIs. Simply replace the Rule or Workflow Node with a Rest API Node configured to target your external API endpoint. Map your parameters accordingly using the iteration data.

1

Set Up Your Workflow

  • Create a new workflow in Nected.

  • Add a Trigger Node (e.g., API or webhook).

2

Integrate Your Data Source

  • Insert a Google Sheets Node (or Database Node for databases).

  • Configure your data source:

    • Select your Google Sheets integration (see Google Sheets integration documentation).

    • Set the action to Lookup.

    • Choose your spreadsheet and worksheet.

    • Confirm header rows and configure appropriate filters.

  • Save the node configuration.

3

Configure the Loop Node

  • Add a Loop Node to your workflow.

  • Pass the Google Sheets Node's output rows into the Loop Node input as the input list.

  • Set optimal configurations:

    • Chunk Size: Typically between 1-50 based on the dataset size.

    • Concurrency: Set to 1-10 based on workflow complexity.

4

Execute Rule, Workflow, or External API Inside Loop

  • Inside the Loop Node, add either a Rule Node, Workflow Node, or REST API Node depending on the target.

  • Map your data tokens from Google Sheets into input fields:

    {
      "basekindlePrice": "{{item.basekindlePrice}}",
      "countrycode": "{{item.countrycode}}",
      "customerTier": "{{item.customerTier}}",
      "inventoryLevel": "{{item.inventoryLevel}}",
      "isBlackFriday": "{{item.isBlackFriday}}"
    }
5

Capture and Update Results

  • Add another Google Sheets Node after the Loop Node.

  • Configure this node to update your Google Sheet:

    • Select the same spreadsheet used initially.

    • Choose action as Update Sheet.

    • Map actual outputs and test statuses (e.g., "matched" or "not matched") back to each row.

6

Execute and Monitor

  • Save and run the workflow.

  • Observe real-time execution in the Workflow Dashboard.

  • Check the Google Sheet or database to confirm updated statuses and results.

Optional: Automated Result Validation

Create a small rule within the loop:

  • If the actual output matches the expected output, update the status to "matched".

  • Otherwise, mark as "not matched".

Bulk Testing External APIs

Nected's Loop Node supports bulk testing external APIs using REST API Nodes within the loop, providing powerful integration and automation capabilities.

Method Comparison

Feature
Postman Collection Runner
Nected Loop Node

Integration Type

External tool

Native integration

Data Source

CSV upload manually

Direct connection

Automation Capability

Basic

Advanced automation

Result Processing

Manual analysis

Automated validation

Reusability

Suitable for one-time scenarios

Ideal for recurring use

Conclusion

Both methods provide robust solutions for bulk testing in Nected. Your choice should depend on test frequency, desired automation levels, and integration capabilities. Importantly, these methods are applicable beyond rules and workflows and are equally effective for testing external APIs, enhancing your overall testing strategy.

Last updated