View this page in the latest version of Appian. Route Workflows Automatically Share Share via LinkedIn Reddit Email Copy Link Print On This Page Suppose your organization wants to process invoices automatically, but only if the total is below a certain threshold. You can use an AI skill to extract the invoice amount then automatically send the invoice down the right path. Use this recipe when you want to: Extract key data points from a document or automated process. Apply business rules to extracted values to guide workflow decisions. Automate routing based on extracted values, such as approval thresholds, to decide whether a process continues automatically or needs manual review. Design structure Set up AI-based data extraction Create a Prompt Builder AI skill to extract fields from an invoice. For this scenario, the prompt might extract: invoiceTotalCost (decimal) invoiceNumber (text) invoiceDate (date) Sample prompt 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <role> You are a helpful AI assistant for sifting through large amounts of information and extracting key details and transforming it into structured data. </role> <use_case> You will be given an invoice with various data elements. </use_case> <steps> Please complete the following steps: 1. Carefully read the user input provided. 2. Read the list of fields to extract identified in <fields> XML tags. 3. Output your response in JSON. </steps> <fields> --invoiceTotalCost (decimal) --invoiceNumber (text) --invoiceDate (date) </fields> <response> Output your response in valid JSON. Use this structure: { "invoiceTotalCost": "", "invoiceNumber": "", "invoiceDate": "" } </response> Add routing logic to your process model Create a new process model, or open an existing one where you want to integrate your AI skill. Add and configure an Execute Generative AI Skill smart service for the extraction AI skill you created. After extracting the data, add an XOR gateway to evaluate the invoiceTotalCost. Compare invoiceTotalCost against the business threshold. If the cost is below the threshold, update the status to "Auto-Approved". If the cost is above the threshold, route to a user input task for manual review. Test it out Here's how to set up routing logic using extracted data in your process model. Extract data: Use a Prompt Builder AI skill to extract required fields. Store the results in process variables. Evaluate the data: Add logic in the process model to compare the extracted values against your business rules. Route the process: Use gateways to direct the process flow based on the evaluation. Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close Tip: For help designing routing logic, see the Process Model Object page. Feedback Was this page helpful? SHARE FEEDBACK Loading...