# Testing Recipes

Workato's integrated recipe testing environment allows you to test your recipe before starting it. Testing ensures your automation's behavior and data processing are correct - you don't want to do a lot of clean-up later!

In this guide, we'll cover:


# Basics

# What is a test job?

A test job is a job that's conducted in Workato's recipe testing environment or test mode. When you run a test job, Workato uses new trigger data from the trigger application to test the unskipped steps in your recipe.

# What is 'test mode'?

Test mode picks up a single trigger event and proceeds through all unskipped actions in the recipe. When finished, the test job is logged in the recipe's job history, and its details will be available for your review.

Cannot run Long Actions in Test mode

Long actions require dedicated Workers to periodically check if the action is complete. This is not available in test mode. Testing a recipe that contains a long action may cause the job to stall in the processing status.

If you recipe contains this list of long action, please use Start Recipe instead.

Default test button Running a test job

# What trigger data is used to run test jobs?

The trigger event used to run a test job depends on the trigger type:

  • Polling triggers check for new events by periodically checking the connected app. The trigger event used to run a test job depends on the trigger's Since/from date:

    Defined since date for a Salesforce object trigger Defined since date for a Salesforce object trigger

    In the above example, the recipe is configured to pick up Salesforce accounts created or updated on or after July 14, 2020 00:00:00. If a trigger event is found, the earliest event - the event closest to the Since/from date - is processed first. Subsequent tests will process the next trigger event in chronological order, and so on.

  • Real-time triggers receive events as they happen. Workato will use the first event received by the trigger to execute the test job. For example, if using a webhook, you should create an event in the source application that sends a notification to the recipe trigger.

  • Recipe function triggers. You provide the trigger event data. If, for example, your trigger requires a user_id value as input, you'll need to provide a sample user_id value to run a test job. Refer to the Manually testing triggers section for more info.

# What's the best way to use test mode?

When building your recipe, we recommend that you:

  • Use sandboxes instead of production accounts. Try to use sandboxes instead of production accounts for testing recipes as a best practice. This practice ensures that you're using realistic data but not working with production, possibly mission-critical data.

  • Build and test incrementally. Build your recipe incrementally and test at logical intervals. Building and testing small segments of the recipe ensures that the recipe flow is coherent and the datapills are mapped properly. It also makes debugging easier.

    Build your recipes incrementally with skip step

    The skip step feature allows you to ignore steps when running a recipe. Skipping steps can be useful when you’re building a recipe and only want to test a part of it.

    Learn more about how to use skip step here.

  • Build and test for all possible scenarios. Recipes can contain multiple paths based on conditional logic. Testing allows you to check that all conditions in your recipe are present and correct.

  • Test all mapped data. To ensure data is processed correctly, ensure you test all data fields and mappings.

    For example, let's say we're moving Account Name, Account Description, and Account Phone data from Salesforce to Zendesk.

    During testing, we'd want to ensure that:

    • These fields in Salesforce have valid data
    • The input fields in Zendesk have the correct values
    • Unexpected or missing values are accounted for if needed

# How do I view test jobs?

To view test jobs from test mode, click the job time dropdown in the job results section. In the menu that displays, click See all test jobs:

View all past test jobs View all past test jobs

Click on individual jobs in the job report table to open the job. Once opened, you can view details for each step or repeat the job.

# Can I repeat a test job?

Yes. Repeated jobs re-use the original job's trigger data but run on the latest recipe version.

To repeat a job from test mode, click Repeat job in the job results section:

Highlighted Repeat job button in test mode Highlighted Repeat job button in test mode

When a job has been repeated, a second dropdown containing the repeat jobs will display next to the job time in the job results section:

Repeat job menu and history Repeat job menu and history

Click on individual jobs in the dropdown to open the job. Once opened, you can view details for each step or repeat the job.


# Limitations

When using test mode for your recipes, keep in mind that:

  • Not all trigger types are supported. The following trigger types can't be used in test mode:

    • Scheduled connector triggers, such as the Salesforce - Scheduled record search using SOQL trigger
    • Workbot commands
  • Some trigger types require manual configuration to test. Recipe function triggers require you to supply test data to run tests. Refer to the Manually testing triggers section for more info.

  • Some trigger configurations can't be modified once the recipe has been tested or started. If a trigger requires a Since/From date, for example, you can't change the date once a recipe has been tested or started.


# Running Test Jobs

IS YOUR RECIPE TEST-READY?

Running a test job requires:

  • A fully configured trigger
  • Valid data mappings
  • Valid connections

Workato will check that your recipe meets these requirements when you click Test. If there's an issue, you'll be prompted to address it.

In Workato, there are two ways you can kick off a test job:

# Testing Triggers

1

In your Workato account, open a recipe in Edit mode.

2

In the Recipe editor, click Test.

After you click Test, Workato will:

  • Check that required fields are populated
  • Validate data mappings, if applicable
  • Validate connections, if applicable

If the data checks are successful, Workato will begin the test job. The test results will display when the job completes.

# Manually Testing Triggers

APPLICABLE TO SELECT CONNECTORS

This section applies to Recipe functions.

1

In your Workato account, open a Recipe function in Edit mode.

2

In the Recipe editor, click Test. The Add trigger data window will display.

3

In this window, provide the data Workato should use to invoke the test job. There are two ways to provide the data:

Form fields view

The Form fields view displays a form with each field configured in the trigger's input. To use it, click Change view > Form fields view.

Enter values for the trigger input fields. Note: Only plaintext and static lists are allowed.

Form fields view for manual trigger testing Configure manual trigger form fields view

Raw JSON

The Raw JSON view accepts a valid JSON object containing the trigger's input fields. To use it, click Change view > Raw JSON view.

Enter values for the trigger input fields, which are the fields in the parameters object:

Raw JSON view for manual trigger testing Configure manual trigger raw JSON view

Along with the input fields (parameters), the JSON view includes a context object. The context object is prefilled with sample output of the calling recipe and job IDs (0), but can be overwritten.

Note: The data in this window will be lost if you refresh or navigate away from the current recipe page.

4

When finished, click Test recipe.

After the manual trigger test data is submitted, Workato will:

  • Check that required fields are populated
  • Validate JSON syntax, if JSON was provided

If the data checks are successful, Workato will begin the test job. The test results will display when the job completes.


# Using Test Results

After the test job completes, the test results will display. Test jobs can result in one of the following:

# Successful Jobs

Successful jobs include the recipe path, input, and output:

Viewing a successful test job Viewing a successful test job

# Failed Jobs

Failed jobs include the recipe path, input, output, and debugging information.

Additionally, Workato will highlight the step at which the error occurred. Click the step view details about the issue, including a description of the error:

Viewing a failed job Viewing a failed job

Fix the errors in build mode before repeating the job or running a new test.

# No Jobs Found

If the test job doesn't find a trigger event, the test job may continue to run until you cancel it.

When trigger events aren't found, we recommend:

1

Checking the trigger's configuration. Some triggers allow you to specify the date from which records are picked up. Verify that this field is correctly configured:

Defined since date for a Salesforce object trigger Defined since date for a Salesforce object trigger

2

Creating or updating a record in the trigger app and testing again. The recipe should pick up the trigger event if the trigger is configured correctly.

In the above example, the recipe is configured to pick up Salesforce accounts created or updated on or after July 14, 2020 00:00:00. If we create or update a Salesforce account now, the test job should detect the event.

3

Creating a copy of the recipe and setting the trigger to an earlier date. This approach allows you to try testing with another date where you know a trigger event will be available.

If, for example, you know a Salesforce account was created on May 31, 2020, set the trigger date in the copied recipe to before this date. This guarantees that at least one trigger event is available to test the recipe.


# Canceling Test Jobs

Cancel an in-progress test job by clicking Stop test (top right corner) or the Cancel job button:

Canceling a test job Canceling a test job