Design Your Own Workflow with Ease: Built-in Control

Customize your workflows with ease using Trinity’s built-in control instructions, so you can adapt to diverse scenarios with accuracy and confidence.

The Challenge

Trinity’s Job Flow feature gives you the flexibility to automate downstream job execution based on preconfigured conditions. However, as your workflows grow more complex, how do you handle logic that goes beyond what the built-in conditions can support?

Solution

Use the SQL Executor component to assign custom return codes that you can apply as logical conditions in your Job Flow, giving you greater flexibility and responsiveness in workflow execution.

Reference Workflow and Steps

Step 1: Assign a Return Code using SQL Executor
Edit the SQL Executor and apply built-in control logic to define a Return Code.
For instance, use a SQL query to count rows in a table and treat the result as a condition for branching.。
  • If the row count is less than or equal to 50, set the return code to 7
  • If the row count is greater than 50, set the return code to 8
    This ensures that the job will return a specific code upon completion based on dynamic conditions.
Step 2: Define Workflow Logic Based on Return Code
When designing the Job Flow, double-click the line connecting two jobs to open the Flow Element Setting.
  • Select the condition type: If(return)
  • In the input box on the right, enter 7 or 8 to match the return codes set in Step 1
  • This condition determines which downstream job should be triggered based on the return code from the upstream job.
Step 3: Execute and Observe Results
Once configured, execute the workflow and observe how Trinity dynamically routes the workflow based on real-time data evaluation, enabling flexible and intelligent flow design.