Losant Workflow Lab

The Losant Workflow Lab is an interactive training tool that provides a set of challenges to solve using Losant's Visual Workflow Engine. The Workflow Lab is intended to be used by both new and experienced Losant Developers to grow their workflow development skills.

If you're new to the Workflow Lab, please review the Workflow Lab Overview before continuing. If you need help, please see the Troubleshooting section below.

Running Tests

Each test will trigger a Losant Webhook with input data. Your workflow is expected to reply to the Webhook with the correct output data.

Next to the name of each test and test suites, you'll see a small run button (). While you're solving each test, it's recommended you use these to run just the specific test or test suite you're working on. If you think you've got everything solved and want to run the entire lab, you can do so with the button below:

Lab Results

0 passed | 0 fail | 0 not run

Math

Run Test Suite

Welcome to your first suite. Each question in this test suite involves solving math questions using a variety of functionality within Losant's Workflow Engine.

The Starter Workflow for this test suite is available here.

For each test in this suite, the input data will be POSTed to the URL above. The specific Test ID will be added as a query param (e.g. https://triggers.losant.com/webhooks/your-webhook-id?id=add-two-numbers).

Add Two Random Numbers

Run Test
Test ID: add-two-numbers

Adding two numbers is a very simple task, but it allows us to get warmed up in the Workflow Engine. The Workflow Engine is all about manipulating the payload, which means you need to know how to access different parts of the payload. Payload paths are dot-separated references to object properties, such as data.body.num1.

In this test, a JSON object containing two random numbers, "num1" and "num2", will be provided to your Webhook. Your workflow should return a JSON object containing a single field, "result", that is the sum of "num1" and "num2".

Resources: Math Node

Example Input

{
  "num1": 3,
  "num2": 5
}

Example Output

{
  "result": 8
}
{
  "num1": 7,
  "num2": 21
}
{
  "result": 28
}

Results


This test has not been run yet.

Troubleshooting

If you have trouble completing a test in the Workflow Lab, a Solution Workflow for each test suite is available on GitHub. Each Solution Workflow is Losant's recommended way of solving these problems.

If the Solution Workflows do not address your concern, feel free to post a question in the Workflow Lab section of the Losant Forums.

Common Problems:

  • If your "Actual Output" for an test looks unfamiliar, be sure to check that you are triggering the correct Webhook/Workflow. It's possible to have two workflows listening to the same Webhook.
  • The Workflow Lab expects your workflow to return valid JSON. It's important to ensure that within the Webhook Reply Node, you add a header of "Content-Type" and it's set to "application/json"