Composio Call
Function: Composio Call
This function allows your application to securely connect with and execute actions from various third-party tools and services that are integrated through the Composio framework. It acts as a bridge, letting you use external functionalities like fetching data, creating records, or updating information in other systems without writing any code. The platform automatically handles the technical details of connecting and managing parameters.
Input
- Toolkit
- Description: The specific integration suite or collection of tools you want to use (e.g., "CRM System API", "Project Management Tools"). This helps categorize and manage different external services.
- Type: An integration suite or collection of tools
- Required: Yes
- Tool Slug (Action Name)
- Description: The unique identifier or name of the specific action or tool you wish to execute within the chosen Toolkit (e.g., "createCustomer", "getLatestReport").
- Type: A specific tool or action within an integration suite
- Required: Yes
- Arguments
- Description: A collection of key-value pairs (like a JSON object) containing any specific information or data required by the chosen Tool Slug to perform its action. For example, when creating a customer, this might include
\{"firstName": "John", "lastName": "Doe"\}. - Type: A collection of key-value pairs (like a JSON object)
- Required: No
- Description: A collection of key-value pairs (like a JSON object) containing any specific information or data required by the chosen Tool Slug to perform its action. For example, when creating a customer, this might include
Output
- Response
- Description: A variable where the function will store the result returned by the external tool after its execution. This could be data, a confirmation message, or other relevant information.
- Type: A variable to store data
- Default Value:
RESPONSE
- Status
- Description: A variable that will hold the outcome of the call. It will be "OK" if the tool executed successfully, or "BAD_REQUEST" if there was an issue with the request sent to the external tool (e.g., missing required arguments for the external tool).
- Type: A text indicating the status of the operation
- Default Value:
STATUS
Execution Flow
Real-Life Examples
Example 1: Successfully Fetching Data
Goal: Retrieve the latest sales report from a Business Intelligence (BI) platform.
Inputs:
- Toolkit:
BI_Platform_Connector - Tool Slug (Action Name):
getLatestSalesReport - Arguments:
(No specific arguments needed for this tool)
\{\} - Response:
mySalesReport - Status:
callStatus
Result: The mySalesReport variable will contain the sales report data, for example:
\{
"reportId": "SR-2023-11",
"date": "2023-11-30",
"revenue": 1500000,
"currency": "USD"
\}
And the callStatus variable will be set to "OK".
Example 2: Creating a Record with Specific Parameters
Goal: Add a new customer to a Customer Relationship Management (CRM) system.
Inputs:
- Toolkit:
CRM_System_API - Tool Slug (Action Name):
createCustomer - Arguments:
\{
"firstName": "Alice",
"lastName": "Smith",
"email": "[email protected]",
"company": "Acme Corp"
\} - Response:
newCustomerDetails - Status:
customerCreationStatus
Result: The newCustomerDetails variable will contain information about the newly created customer, for example:
\{
"customerId": "CUST-001",
"status": "active",
"creationDate": "2023-12-01"
\}
And the customerCreationStatus variable will be set to "OK".
Example 3: Handling an Invalid Request to the External Tool
Goal: Attempt to update an order in an E-commerce system with an invalid order ID.
Inputs:
- Toolkit:
Ecommerce_API - Tool Slug (Action Name):
updateOrder - Arguments:
(Assuming "INVALID-ORDER-123" does not exist in the E-commerce system)
\{
"orderId": "INVALID-ORDER-123",
"status": "shipped"
\} - Response:
orderUpdateResponse - Status:
orderCallStatus
Result: The orderCallStatus variable will be set to "BAD_REQUEST", indicating that the external system rejected the request. The orderUpdateResponse variable might contain an error message from the E-commerce system, for example:
\{
"error": "Order not found",
"errorCode": "404"
\}