What You'll Learn
By the end of this article, you'll know how to extend your recipes with inline code when visual steps aren't enough, how to use Lookup Tables and Data Tables for persistent cross-recipe storage, and how to implement robust error handling so failures are caught, surfaced, and recoverable.
Code Snippets
For logic too complex to express using standard recipe actions, PlanRadar Connect supports inline code snippets in Python, Ruby, and JavaScript.
When to use code snippets
Date calculations — computing dynamic date ranges (e.g. every day but not weekends).
Complex string manipulation — parsing, reformatting, or transforming text values that formula mode can't handle cleanly.
Batch processing logic — operations that would require dozens of visual steps to replicate, but can be expressed concisely in code.
Setting up a code snippet step
Add a Code Snippet step to your recipe.
Select your language: Python, Ruby, or JavaScript.
Define your inputs — the values you want to pass into the snippet from previous steps (exposed as variables inside the code).
Define your output schema — the values the snippet will return for use in subsequent steps.
Write your code in the editor.
Execution characteristics
Snippets execute in milliseconds for typical scripts.
There is an execution time limit (typically 30 seconds), but this is rarely reached for the kinds of transformations and calculations done in recipes.
Code snippets are stateless — they receive inputs, process them, and return outputs. They do not retain state between runs.
Tip for power users: You can use AI tools (e.g. ChatGPT, Claude) to generate code snippet logic. Describe the transformation you need in plain language and paste the output into the code editor. Always test with representative sample data before activating.
Data Tables & Lookup Tables
Both Lookup Tables and Data Tables provide persistent storage that recipes can read from and write to across multiple runs and across different recipes. They are not cleared between jobs.
Lookup Tables
The simpler option. Best for reference data that changes infrequently.
Can be populated via CSV upload — no recipe required to seed the data.
Recipes can search for records by key.
Ideal for mapping one identifier to another — for example, mapping a project manager's email address (stored in a custom field) to their PlanRadar user ID (needed to assign them as a ticket owner).
Data Tables
More powerful and flexible, but requires more setup.
Cannot be populated via CSV — must be populated programmatically by a recipe or manually.
Supports advanced operations like upsert (insert a record only if it doesn't already exist, based on a unique key).
Can be scoped to a specific project if the data is project-specific.
Better suited for dynamic, frequently changing data that recipes write to and read from as part of ongoing automation.
Choosing between them
| Lookup Table | Data Table |
CSV upload | ✅ Yes | ❌ No |
Recipe-writable | ✅ Full support | ✅ Full support |
Upsert support | ❌ No | ✅ Yes |
Best for | Static reference mappings | Dynamic, recipe-maintained data |
Error Handling with Error Monitor
By default, if an error occurs in a recipe step, Workato sends a notification email to the address configured in your Usage Details settings. This is a reasonable baseline, but for production-grade recipes you should implement explicit error handling.
Adding an Error Monitor block
Wrap one or more steps in an Error Monitor block to gain control over what happens when those steps fail.
With an Error Monitor, you can:
Configure automatic retry — retry the failed step up to 3 times before giving up. Useful for transient failures like network timeouts or temporary API unavailability.
Define a custom email notification with specific context about the failure (e.g. which ticket ID caused the error, what value was being processed). This makes it actionable rather than a generic failure alert.
Apply different error handling logic to individual steps — useful when one step is known to be fragile (e.g. an external API that occasionally times out) and needs special treatment without affecting the rest of the recipe's error handling.
Error handling strategy recommendations
For external API calls: Add retry logic (up to 3 attempts) to account for transient connectivity issues.
For critical recipes: Configure custom email notifications that include enough context to act on the error immediately — job ID, the data that was being processed, and the step that failed.
For the Stop Job action: Use this inside an Error Monitor's fallback path when you want to cleanly terminate a job that has encountered an unrecoverable condition, and report it as failed with a clear reason.
Workato Tools Reference
The following built-in Workato tools are available in PRC and are relevant to advanced recipe building:
Tool | Purpose |
Scheduler | Add a wait/delay between steps. Essential for API rate limit management in loops. |
Variables | Create and update variables within a recipe run. |
Code Snippets | Inline Python, Ruby, or JavaScript execution. |
CSV Tools | Create, read, or manipulate CSV files within a recipe. |
File Tools | Download a file from a URL and upload it elsewhere (e.g. move a PlanRadar export to external storage). |
PDF Tools | Manipulate PDF files. |
SQL Collections | Run SQL queries against in-memory data within a recipe. Useful for filtering large datasets returned by an API without additional API calls. |
Logger | Output data to the job log for debugging. Use during development to inspect values at specific points in the recipe. |
Callable Recipe (Function) | Create a recipe that can be called from other recipes — like a reusable function or microservice. Eliminates duplication of shared logic across recipes. |
Comments
0 comments
Please sign in to leave a comment.