Product Recall Agent

Resource Page Link

This is the challenge page where you will interact with the product recall process, get your API key, and see the results of the agent in action.

https://pathfinder.automationanywhere.com/challenges/training/MHG/WorkerPortal.html

API Documentation Page Link

The resource below has all the API Documentation for this process.

View API Documentation (YAML)

1. Configuring the Disposition Work Item tool

Steps:

  1. 1. Navigate to the following directory: Demo Agents > Customer Complaints > Tools
  2. 2. Open the Disoposition work item tool.
  3. 3. This API Task performs one main objective:It updates the work item in the back end of our system of record.
  4. 4. Edit each variable to have the following descriptions.
    • complaintID:
      This is the unique id of the complaint that is currently being worked.
    • dispositionReason:
      This is the desired reason used to disposition the current work item.
    • dispositionStatus:
      This is the desired status used for dispositioning the current work item.
    • recallRecommendation:
      This yes/no flag denotes whether a product is recommended for recall and is part of the dispositioning of a work item.
    • ErrorMessage:
      If populated, this contains the error that came back from the tool call.
    • Response:
      This is the response from the system with details on the disposition.  It includes any recall ID if one was recreated.
  5. 5. Edit the description of the task itself by mousing over the name and clicking the pencil.
    This tool updates the current work item with the decisions made during this business process.

2. Updating the 'Add Customer to Recall' tool

Steps:

  1. 1. Still within the Tools folder, open addCustomertoRecall.
  2. 2. This tool is an API Task — the back-end system supports REST calls. Refer to the API Documentation linked at the top of this page. Navigate to the Recalls section and open the POST /add-recall-impacted-customer method to review the request format and required fields.
  3. 3. In the left sidebar, under Actions, scroll down to find Rest Webservices. Expand it and drag in a Post method into the canvas.
  4. 4. Fill in the URI:
    https://wmkjvdlsxeohfnsyftag.supabase.co/functions/v1/add-recall-impacted-customer
  5. 5. Scroll down to the Headers section and click Add Header.
    • In Name, enter: Authorization
    • In Value, select Insecure String and enter: Bearer $APIKey$ — you can press F2 to map the variable from the dropdown, or type it manually.
  6. 6. Paste the following into the Body field:
    {
    "recallId": "$recallID$",
    "customerId": "$customerID$",
    "orderId": "$orderID$",
    "impactAmount": $impactAmount.Number:toString$,
    "contactInformationType": "$contactInformationType$",
    "contactInformation": "$contactInformation$"
    }
  7. 7. Scroll down and expand Advanced Options. Check the Capture Failure Response checkbox — this ensures that if the API call fails, the error is captured and passed back to the agent through error handling.
  8. 8. Scroll down to Assign the output to a variable and click Add Variable Mapping.
    • In Key, type: Body
    • Select Response as the output variable.
  9. 9. Save and close the tool.

3. Configuring the Product Recalls AI Agent

Steps:

  1. 1. Navigate back to the Customer Complaints folder and open the Product Recalls AI Agent. Press skip on the first pop up, we'll come back to that.
  2. 2. You will see three tabs: Prompt, Tools, and Tests. Click on the Tools tab first.
  3. 3. Five tools are already present. Click on any of them to see the details on the right.
  4. 4. Click Add Tool and select API Task. Click Choose and browse to one of the two tools you modified in Steps 1 and 2.
  5. 5. Repeat Step 4 to add the second modified tool.
  6. 6. Switch to the Prompt tab. This is where you define the agent’s role, goal, and action plan — how it understands the business process.
  7. 7. You can click Generate and provide a brief description to auto-populate a prompt. You will notice one is already pre-populated from the original creation. Click Generate again to see it fill out with references to the tools and their functions.
  8. 8. For this session, use the prompt below it has been verified to work correctly. Replace the existing Role, Goal, and Action Plan with the following:
    • Role:
      You are a quality assurance specialist with expertise in product recalls, customer complaint resolution, and workflow optimization.
    • Goal:
      Your goal is to review the work item, determine the appropriate disposition using available tools, and add impacted customers to the recall if applicable.
    • Action Plan:
      # Assumptions
      - The work item contains all necessary details, including complaint ID, product information, and previous dispositions from other teams
      - Tools are available to analyze product detail and order history.
      - Recall recommendations are based on product testing results and business rules.
      
      # Process
      1. Retrieve the work item details, including complaint ID, product information, and customer data.
      2. Retrieve the product’s order count history using the GetOrderHistory Tool and complaint count using the Get Historic Complaints tool.
      3. Use the ‘ProductReviewBusinessRules’ tool to analyze the complaint and determine the disposition based on inputs such as product testing results and customer disposition.
      4. Update the work item status using the ‘Disposition Work Item’ tool, including the disposition reason and recall recommendation.
      5. If the disposition indicates a recall:
         - Use the ‘GetProductDetails’ tool to gather the price information.
         - Use the ‘GetOrderHistory’ tool to identify impacted customers based on associated orders.
         - Use the ‘Get Historic Complaints’ tool to identify which impacted customers had their complaints rejected.  Take this population and use the ‘addCustomertoRecall’ tool to add them to the recall list, including their order details and contact information.  Use mailing address when available, use phone number as a backup.
      6. The output summary should provide a reviewer full insight into what happened and why.
      
      # Guidelines
      - Ensure all inputs to the tools are accurate and complete.
      - Follow business rules strictly when determining dispositions.
      - Maintain clear documentation of all actions taken for audit purposes.
      - Handle errors gracefully and retry failed tool operations if necessary.
  9. 9. Select Save.
  10. 10. Navigate back to the root folder and open the Product Review Process.
  11. 11. The process contains three steps: an API Task, the AI Agent, and a form for reviewing the agent's output.
  12. 12. Click Run. Paste in your API Key from the Welcome page and click Confirm.
  13. 13. Leave that tab open. Go back to the Product Recalls agent and open the Tests tab to watch it work in real time — observe which tools it calls and how it maps inputs at each step.
  14. 14. Once complete, return to the process tab and open the Summary Review Form task to see the full summary of the agent's work.