# Validate Coupa expenses with an expense genie

This use case connects your Coupa account to a genie configured with specialized skill and knowledge base recipes that turn your genie into a customized expense validator. The skill recipe triggers when a user uploads a receipt image, such as a jpg, png, or PDF.

The genie automates your expense workflow by extracting relevant expenses from employee receipt uploads. This ensures that the receipt is the source of truth and removes the need for manual entry.

# What does this genie do?

This genie enables you to connect your knowledge base to your Coupa account to empower your genie with company-specific knowledge. It uses a custom skill recipe to teach your genie how to validate and process expense receipts."

flowchart TD subgraph M[" "] direction LR subgraph D[&nbsp Create a <br/> genie &nbsp] direction LR end subgraph DD[&nbsp Add a <br/> detailed job description <br/> and an AI model &nbsp] direction LR end end subgraph Q[" "] direction LR subgraph RR[&nbsp Create a knowledge <br/> base recipe &nbsp] direction LR end subgraph RRR[Connect your <br/> Coupa account] direction LR end end subgraph N[" "] direction LR subgraph O[&nbsp Create a <br/> skill recipe &nbsp] direction LR end subgraph OO[Give your genie <br/> the ability to determine <br/> when a user wants to submit <br/> an expense and when <br/> they're asking <br/> expense-related questions. ] direction LR end end A([Build a custom <br/> expense genie]) -- Create your genie --> M -- Optional. Create a <br/> knowledge base <br/> recipe --> Q -- Create skills --> N --> B([Validate expenses before <br/> submitting to Coupa]) D --> DD O --> OO RR --> RRR classDef default fill:#fff,stroke:#67eadd,stroke-width:2px; classDef WorkatoTeal fill:#67eadd,stroke:#67eadd,stroke-width:2px,color:#000; classDef WorkatoPink fill:#fff,stroke:#f66,stroke-width:2px; classDef WorkatoBlue fill:#fff,stroke:#5159f6,stroke-width:2px,color:#fff; classDef WorkatoPurple fill:#fff,stroke:#a99ff5,stroke-width:2px,color:#000; classDef SubgraphDash fill:#67eadd,stroke:#f66,stroke-width:2px,color:#000,stroke-dasharray: 5 5 classDef SubgraphDashPurple fill:#a99ff5,stroke:#f66,stroke-width:2px,color:#000,stroke-dasharray: 5 5 classDef SubgraphDashBlue fill:#5159f6,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5 class A,B WorkatoTeal class O,OO SubgraphDash class D,DD SubgraphDashPurple class RR,RRR SubgraphDashBlue class M WorkatoPurple class Q WorkatoBlue

# Create your knowledge base recipe

Complete the following steps to create a custom expense genie that enables you to upload and verify files and images, such as itemized recipes, before you submit expenses to Coupa:

USE CASES ARE INTENDED AS EXAMPLES ONLY

Use cases are intended to serve as examples. Genie modifications, such as triggers or custom actions, may require adjustments for your specific setup.

1

Sign in to Workato.

2
Create a Coupa connection.

# Create a Coupa connection

This step creates a connection between Workato and your Coupa account.

You must create an OAuth 2.0 client in Coupa before you can connect to Coupa in Workato. Complete the following steps to set up the client in Coupa and configure your Coupa connection in Workato:

1

Sign in to your Coupa instance. For example: https://[your-instance-name].coupacloud.com/oauth2/clients

2

Go to Setup > Integrations > OAuth2/OpenID Connect Clients.

3

Click Create to create a new OAuth client.

4

Use the Grant type drop-down menu to select Client credentials or Authorization code. You must select the same option in Workato for the Authentication type.

5

Provide a name in the Name field. For example: Workato Coupa OAuth connection.

6

Enter the redirect URIs you plan to use in the Redirect URIs field. Add the link https://www.workato.com/oauth/callback if you plan to use Authorization code.

7

Provide a login and valid contact details under Client credentials. Include the contact's first name, last name, and email.

8

Select the scopes you plan to provide to Workato. Include all objects and features you plan to automate with the Coupa connector. These scopes must match the ones you configure in Workato. You must include the core.common.read scope to establish a connection.

Coupa creating a clientCreate a new client

9

Click Save.

10

Copy and store the Identifier and the Secret for use in Workato.

Coupa saved client connection settingsSave your connection details

11

Return to your Workato account and go to the project where you plan to add your connection.

12

Click Create > Connection.

13

Search for and select Coupa on the New connection page.

14

Enter a name for your connection in the Connection name field.

15

Use the Location drop-down menu to select the project or folder to store your connection.

16

Use the Authentication drop-down to select the Grant type provided in Coupa.

17

Provide your client ID in the Client ID field.

18

Provide your client secret in the Client secret field.

19

Enter the Coupa URL for your instance in the Host field. For example, enter acme if your URL is http://acme.coupacloud.com.

20

Go to the Scopes section and select the same scopes you configured in Coupa. Include the required scope core.common.read to connect successfully.

Coupa connector connection settings for OAuth 2.0 connectionCoupa connector connection settings for OAuth 2.0

21

Click Connect.

3
Create a genie.

# Create a genie

This step creates a genie where you can store your knowledge base and skills.

1

Click Create to build your own genie.

2

Enter a request or goal for your genie in the What would you like your genie to help with? field.

3

Use the Save genie in drop-down menu to select a location for your genie.

4

Click Start building. The genie Build page displays with the Job description automatically generated based on the input you provide to the What would you like your genie to help with? field during genie setup and can be edited to suit your requirements.

Genie build pageGenie build page

4
Optional. Create a knowledge base.

# Create a knowledge base

This step creates a knowledge base where you can store your knowledge base recipes. This use case doesn't require a knowledge base. Adding a knowledge base enables you to enhance the genie's capabilities with policy documents or other information sources.

1

Go to the genie Build page.

2

Go to the Knowledge base section and click + Add > New knowledge base.

3

Provide a name for your knowledge base in the Name field.

Create a knowledge baseCreate a knowledge base

4

Enter a description for your knowledge base in the Description field. Genies use descriptions to understand the context and purpose of the knowledge base to determine when to use it.

5

Use the Location drop-down menu to select a location for your knowledge base.

6

Go to the How will you add data section and select Uploads and recipes.

7

Click Create knowledge base.

5
Optional. Create a knowledge base recipe.

# Create a knowledge base recipe

Knowledge base recipes function like other Workato recipes, but must contain the Store document in a knowledge base action. This use case doesn't require a knowledge recipe. However, adding a knowledge base and recipe can enhance your genie with company policies, spending rules, and other internal information.

1

Go to the Knowledge bases section and select the knowledge base you created in the preceding steps.

2

Click Create knowledge recipe.

3

Enter a name for your knowledge recipe in the Name field.

4

Use the Location drop-down menu to select a location for your knowledge recipe.

Set up your knowledge recipeSet up your knowledge recipe

5

Click Start building. The recipe editor opens with the Store knowledge in a knowledge base action automatically selected.

Knowledge recipe with Store knowledge in a knowledge base action automatically selectedKnowledge recipe with Store knowledge in a knowledge base action automatically selected

6
Create a skill recipe.

# Create a skill recipe

This step creates a custom skill recipe that enables your genie to process uploaded images.

1

Go to the genie Build page.

2

Go to the Skills section and click + Add > Skill.

3

Select New skill.

Select New skillSelect New skill

4

Click Create new skill.

5

Provide a name for your skill in the Name field. For example: Scan images/files into Coupa

6

Use the Location drop-down menu to select a location for your skill recipe.

7

Click Start building. The recipe editor opens with the Start workflow trigger and Return response action automatically selected.

8

Select the Start workflow trigger.

9

Enter the following description for your skill workflow in the When should your genie run this skill? field. This description helps the genie recognize when to process an expense versus when a user asks a general question.

Run this skill when:
- A user uploads a receipt image (jpg, png, PDF)
- The user asks to process an expense, submit an expense, or create an expense report
- Keywords: "receipt", "expense", "reimbursement", "submit receipt"

Do not run this skill for:
- General questions about expense policies
- Questions about past expenses without uploading a receipt
- Requests to view or search existing expense reports

10

Go to the What inputs will your genie require to run this skill? section and click Use JSON to provide a description of the schema recipe parameters.

11

Click Use JSON.

12

Paste the following JSON schema into the JSON sample field and then click Next.

{
  "expense_fields_schema": {
    "transaction_date": {
      "type": "date",
      "description": "When the transaction happened",
      "format": "YYYY-MM-DD"
    },
    "amount": {
      "type": "string",
      "description": "Total amount of the receipt or invoice"
    },
    "expense_name": {
      "type": "string",
      "description": "Specific name of the expense"
    },
    "description": {
      "type": "string",
      "description": "Item description"
    },
    "currency": {
      "type": "string",
      "description": "Currency that the expense report is in"
    },
    "expense_category": {
      "type": "string",
      "description": "Specify the predefined categories that is accepted in your expense management system"
    }
  }
}

13

Review the sample JSON tree and then click Generate schema.

14

Go to the What should be returned to the genie after this skill is run? section and click Use JSON. The What should be returned to the genie after this skill is run? section defines the RETURN response for the genie step at the end of your recipe.

15

Paste the following JSON schema into the JSON sample field and then click Next.

{
  "output_fields": {
    "summary_response": {
      "type": "string",
      "description": "Defining this output allows the Genie to return a defined response after the recipe has completed the execution"
    }
  }
}

16

Review the sample JSON tree and then click Generate schema.

7

Click + Add step and select Handle errors.

Add actionClick + Add step > Handle errors

How does the Handle errors control statement work?

The Handle errors control statement allows you to monitor your recipe for errors in actions, similar to the try/catch concept in programming languages. You have the opportunity to perform the following actions if an error occurs:

  • Retry the sequence of actions again, in case it was a temporary error such as network issues.

  • Take remedial actions, such as notifying users of the error through email or error messages in the app, or to carry out a rollback. For example, you can reverse the job by deleting any created or half-created records.

This control statement consists of two blocks: the Monitor block and the Error block. Place the actions that you plan to monitor for errors within the Monitor block. If all actions are successful, Workato ignores the Error block. However, if any action in the Monitor block results in an error, the actions within the Error block are executed.

graph TD A(Monitor action for errors) ---> B((Error found?)) B --> C{Yes} B --> D{No} C --> E(Define how to <br/> handle the error) D --> F(Continue processing <br/> the recipe) classDef default fill:#67eadd,stroke:#67eadd,stroke-width:2px,color:#000;
8
Set up your Coupa Create Object action.

This step creates an expense line in Coupa. Note that this step is nested within the Monitor block.

1

Search for and select Coupa as the app to monitor.

2

Select the Create object action.

3

Use the Object drop-down menu to select Expense line.

Set up your Expense line actionSet up your Expense line action

4

Ensure that Return type is set to default.

5

Map the Description Step 1 datapill to the Description field.

6

Map the Transaction date Step 1 datapill to the Expense date and Start date fields.

7

Click Save.

9
Configure your ERROR FOUND? block.

This step defines how the recipe responds if the Expense line action returns an error.

Complete the following steps to configure your ERROR FOUND? block:

1

Go to the ERROR FOUND? block and confirm that the Yes branch shows DO NOT RETRY. This option is typically set by default.

Error found blockERROR FOUND? block

2

Go to the Yes branch and click Select and app and action.

3

Search for and select Workato Genie as your app.

4

Select Return response to genie as your action.

5

Map the Error type Step 4 datapill to the Type field.

6

Map the Error message Step 4 datapill to the Description field.

Map the error informationMap the error information

7

Click Save.

8

Go to the No branch. The Return response to genie action should already be present.

9

Click the Return response to genie action to open it.

10

Map the Type Step 1 datapill to the Type field.

11

Map the Description Step 1 datapill to the Description field.

Map the error informationMap the response information

12

Click Save.

Example genie recipe configuration

Configured genie recipe exampleConfigured genie recipe example


Last updated: 1/27/2026, 11:15:38 PM