Function Calling
This concept page explains what these functions are, how they differ, and the key ideas behind how they work in agent-powered applications.
What Are Function Calls?
Agents in Appsmith can interact with your application logic through two primary types of function calls:
-
Query Functions – for interacting with external systems and data sources.
-
JavaScript Functions – for implementing business logic and workflows.
Query Functions
Query functions are operations that allow agents to interact with external systems and data sources in Appsmith. These functions are typically used to retrieve, send, or manipulate data and are defined using Appsmith's built-in query editors.
They form the foundation for external communication in agent-driven workflows, enabling access to APIs, databases, and third-party services.
Query functions can connect to a variety of data sources, including:
-
REST APIs — for sending HTTP requests to external services.
-
SQL and NoSQL Databases — such as PostgreSQL, MySQL, MongoDB, etc.
-
GraphQL Endpoints — for querying or mutating structured APIs.
-
Third-party Integrations — including services like Stripe, Twilio, or SendGrid.
When an agent needs to retrieve, create, update, or delete data, it can invoke query functions that you've configured in your application.
Use Cases
Agents may invoke query functions in a wide range of scenarios, including:
- Retrieving a list of users from a database.
- Submitting form data to an external API.
- Filtering product listings based on search criteria.
- Creating a new order record in a backend system.
- Fetching shipping status from a third-party logistics service.