REST API Task – Status Loop Check and Continue Check Value Explained

Overview

Many REST APIs work asynchronously. Instead of returning data immediately, they first respond with a status such as Pending or Processing, and only later change to a final state like Completed or Failed.

To handle this pattern, the REST API Task in ZappySys provides a Status Check loop, which repeatedly polls the API until a terminal status is reached.

This article explains:

  • How Status Loop Check works
  • How to correctly configure Continue Check Value
  • Why regex patterns are required
  • Common mistakes and best practices

Common Problem Scenario

Users sometimes notice that:

  • The REST API Task does not wait
  • The workflow moves to the next ETL step immediately
  • Status values like Pending or Processing are ignored
  • Data gets downloaded or processed before the job is completed

This usually happens due to an incorrect Continue Check Value configuration.


Understanding Continue Check Value / Regex Pattern

The field:

Continue Check Value / Regex Pattern

expects a single regular expression, not multiple plain-text values.

:cross_mark: Incorrect Examples

Pending, Processing
Pending Processing

These values are treated as literal strings and do not match, causing the loop to exit immediately.


Correct Way to Handle Multiple Status Values

If the API can return more than one “in-progress” status, you must use a regex OR (|) operator.

:white_check_mark: Correct Example

Pending|Processing

This tells the REST API Task:

Continue looping as long as the status is Pending OR Processing.


Recommended Status Check Configuration

In the Status Check tab, configure the fields as follows:

Setting Value
Enable Status Check Enabled
Continue Check Value / Regex Pattern Pending
Success Value / Regex Pattern Completed
Fail Value / Regex Pattern Failed

This ensures the task:

  • Keeps polling while the job is still running
  • Exits only when processing is complete
  • Fails immediately if an error status is returned

Important: Case Sensitivity in Regex

Regex matching is case-sensitive by default.

That means:

  • Pendingpending
  • Processingprocessing

If your API returns lowercase values

Either match the exact case:

pending|processing

Or use a case-insensitive regex (recommended):

(?i)pending|processing

The (?i) flag makes the match case-insensitive.


Verify Response Settings

To ensure reliable matching, also verify the Response Settings tab:

  • Response Content Type = JSON
  • Filter / JSON Path extracts only the status value

Example JSON Path

$.status

If the JSON Path returns extra text or objects, the regex comparison may fail.


How Status Loop Check Works (Flow)

  1. REST API Task executes
  2. Status value is extracted from the response
  3. Value is evaluated against:
  • Continue Check regex → loop continues
  • Success regex → task succeeds
  • Fail regex → task fails
  1. The task keeps polling until a terminal condition is met

Final Result

With the correct regex-based configuration:

  • The REST API Task waits properly during Pending / Processing
  • The workflow proceeds only after Completed
  • Premature ETL execution is avoided
  • Data loads remain accurate and consistent

Key Takeaways

  • Continue Check Value uses regex, not plain lists
  • Use | to match multiple in-progress statuses
  • Watch for case sensitivity
  • Validate JSON Path output