NewIntroducing Arbiter AI. Experience the boundless capabilities of AI, right inside Arbiter. Check it out
  • Intro
    • Automations
    • Complex Decision-Making
    • Integrations
  • Docs
  • Support
  • Pricing
Try Arbiter

    Introduction

  • What is Arbiter?
    • Overview
    • Automations and Integrations
    • Decision-Making Software
    • Overview
    • Configure the Start Node
    • Connect to an HTTP API
    • Use Processor for Math Calculations
    • Add Conditions with Rule Node
    • Output Data and Workflow Tests
  • Concepts
  • Workflows

  • Projects
    • Intro
    • Workflow data state
    • Result schema
    • Canvas actions
    • Start node
    • Connector node
    • Rule node
    • Processor node
    • Workflow node
    • Setter node
    • Intro
    • Http request
    • Intro
      • Overview
        • Overview
        • Text
        • Date and Time
        • Math
        • Overview
        • Text Template
        • Find
        • Filter
  • Variables
    • Checkpoints
    • Workflows status
  • Data Types
  • Input Parameters Form
  • Arbiter AI
  • Visibility and Audit
  • Troubleshoot & FAQ

  • Roadmap
  • Changelog
Type '/' to Search

•Output Data and Workflow Tests

Workflows could return a value or not, depending on your purpose. For this example, you'll configure the workflow to return a value. If the desired quantity is available, you'll make a HTTP POST request creating a new order. After that you'll return an object with two fields: id of the newly created order and a text message success. Otherwise, if there are not enough units, you'll return not enough units message and -1 value for an id.

•Failed scenario

First, lets cover the case when there is not enough units.

  1. Drag & Drop the Setter node to the canvas
  2. Double click on the node to open the configuration settings
  3. Select Set up result types button
  4. Activate the Workflow returns a value switch
  5. Select plus button and change key value to message
  6. Select plus button again, change key value to orderId and type to number
  7. Select Apply button
  8. Write the not enough units message in the text field message
  9. Put -1 to the orderId field
  10. Change the node's name to FailedOrder for example
  11. Select Apply

•Create an HTTP POST query

  1. Drag & Drop the Connector to the Canvas
  2. Connect Rule node with the Connector node
  3. Double click on the Connector to open the settings
  4. Click on Create connector button
  5. Give a name to the HTTP request, e.g. CreateOrder
  6. Select Create button and you'll be redirected to the HTTP query builder
  7. Enter the URL pointing to the orders resource.
    https://northwind.vercel.app/api/orders
    
    https://northwind.vercel.app/api/orders
  8. Change request type from GET to POST
  9. Open the Body tap and configure add two fields: quantity and productId with type number.
  10. Save the request and select Test request button. For productId pass 30 and for quantity 5 for example.
  11. You'll see that Status is 201 Created which means that your order is created successfully. Also the API returned an id for the newly created order.
  12. Select Build schema button, click on Save button and finally select a Return to OrderProduct link.
  13. Select CreateOrder connector from the dropdown and set the Node name, e.g. CreateOrder
  14. Select Apply

•Add Another Setter to Return Success Message

You've already configured the result schema, so you just need to set a different result.

  1. Drag & Drop the Setter node to the canvas.
  2. Double click on the node to open configuration settings.
  3. Write the success message in the message field.
  4. Select Use variable from state button, click on Select field... and then select CreateOrder.productId. Learn more about input parameters form.
  5. Change the node's name, e.g PlacedOrder
  6. Select Apply.

•Test the workflow

  1. Select Test button, for productId enter 30, and for quantity 5 units
  2. As expected the order was created. Select Details tab to examine in depth workflow execution.
  3. Now lets start another test with same productId, but with a much larger amount, e.g. 56

DocsContactLegalCookies
©2022-2023 Arbiter Technologies Ltd. All rights reserved.