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
PendingorProcessingare 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.
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.
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:
Pending≠pendingProcessing≠processing
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)
- REST API Task executes
- Status value is extracted from the response
- Value is evaluated against:
- Continue Check regex → loop continues
- Success regex → task succeeds
- Fail regex → task fails
- 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