# Connect to External Systems with an Integrator

# Connect to External Systems with an Integrator

Integrator components connect your workflow to external systems, such as cloud storage or databases. You can use them to fetch input files, send data for processing, or store outputs.

To demonstrate a practical application of this, we'll use an Integrator in the following use case.

Use Case: Build an Expense Report Processing Workflow

In this use case, you'll learn how to create an Automated Workflow that retrieves receipt files from an S3 bucket, classifies each file using an Agent, and extracts relevant data from documents identified as receipts for an expense report. The goal is to help you build, test, and publish a complete automation pipeline in just a few minutes.

This use case illustrates a full-cycle integration pattern:

Download Extract → Process → Compare → Store

Prerequisites:

  • You have a pre-built and published Automation Agent capable of classifying documents.

  • You have a pre-built and published Automation Agent capable of extracting data from receipts.

Step 1: Create the Automated Workflow Agent

First, you'll create the foundation for your workflow's logic and configurations. This agent will act as the container for all the components and steps in your process.

  1. Navigate to the Expert Agent Studio module.

  2. Click the + Build button in the top-right corner.

  3. In the What would you like to create? dialog, select Automated Workflow.

  4. In the Solution Details section, provide the following:

    • Name: Expense_Report_Workflow

    • Description: Classify and extract incoming receipts from S3

    • Visibility: Private

  5. Click Create to launch the canvas and begin designing your workflow.

Step 2: Configure the Start Node

Next, you'll define how the workflow is triggered. This is the essential first step that determines how your process begins.

  1. Click the Start node on the canvas.

  2. Under How Should This Workflow Start?, choose Manual or API Trigger.

  3. In the Input Variables section, define the following input:

    • Input Name: Input_Path

    • Data Type: Text

    • This input defines the folder path in the S3 bucket that the workflow will monitor.

Step 3: Declare Environment Variable for S3 Bucket

Before adding the S3 connector, you'll define an environment variable for the bucket name. This makes the bucket reference reusable across your workflow and ensures it's correctly picked up during execution.

  1. Navigate to the top header and click the Settings icon.

  2. In the Environment Variables section:

    • Click + Add Variable.

    • Label: Bucket_Name

    • Value: employee-receipts-bucket (replace with your actual bucket name). This variable will now be available for use in the S3 component configuration.

Step 4: Add an AWS S3 Download Connector

Now, you'll connect the workflow to Amazon S3 to retrieve the receipt files. This component handles the interaction with the external cloud storage service.

  1. Click the + button after the Start node.

  2. Select AWS S3 and set the Operation to Download.

  3. In the Configuration Panel, set the following:

    • Connection: Choose a valid connection (e.g., S3_Finance_Connector).

    • Bucket Name: Select the Bucket_Name environment variable.

    • Path: Map to Input_Path (defined in the Start node).

Step 5: Add a Loop to Process Each File

Because the S3 connector can return multiple files, a loop is needed to perform the same set of actions on each one individually.

  1. Click the + button after the AWS S3 Download component.

  2. Select the Loop component.

  3. In the Configuration Panel, configure the following:

    • Input Variable: Select AWS S3 → files.

    • On Error Action: Choose Continue on Error. This ensures that if one file fails to process, the loop will still proceed to the next file.

Step 6: Add a Classification Agent Inside the Loop

You'll use an Agent to determine whether each document is a receipt. Placing this component inside the loop ensures it runs for every file retrieved from S3.

  1. Inside the Loop, click the + button.

  2. Select the Receipt Classifier agent.

  3. In the Configuration Panel, map the agent's input:

    • Input (Receipt): Map to Loop → item.

    • This ensures that each file is passed to the agent one at a time.

Step 7: Add Conditional Logic to Handle Receipts

Next, you'll branch the flow with an If/Else component. This allows your workflow to make a decision and take different actions based on the classification result.

  1. Add an If/Else component after the classification agent.

  2. In the Configuration Panel, set the Condition: Receipt Classifier -> Expense_type equals meal_receipt

  3. In the True (If) branch (this path runs if the condition is met):

    • Add the Receipt Extraction agent.

    • Input: Map to Loop → item

    • This agent performs structured extraction from documents confirmed as receipts.

  4. In the False (Else) branch (this path runs if the document is not a receipt):

Step 8: Test and Publish the Workflow

Finally, you'll validate the workflow to ensure correctness before publishing. Testing is a critical step to catch errors before the workflow is live.

  1. Click Test in the top header.

  2. If your workflow uses a Manual Trigger, you will be prompted to enter an input path.

  3. After the test completes, click on any component to view its Inputs, Outputs, and Traces. This is the primary way to debug your workflow's logic.

  4. Once the workflow behaves as expected, click Publish.

At this point, your workflow successfully automates the process of retrieving receipts, using Agents to classify and extract key data, and intelligently routing documents for further action.