Create tools to connect your systems and do things
Tools in superglue are reusable workflows that you can execute on-demand, schedule, or trigger via webhooks. Each tool consists of sequential steps with built-in data transformations, loops, and error handling.Learn more about how tools fit into the bigger picture in our core concepts page.
Via Agent
Via UI
Via SDK
The fastest way to create a tool is by talking to our agent. Describe what you want to accomplish and the agent will build the tool for you.Simple example:
Copy
Ask AI
"Create a tool that fetches all active customers from Stripe"
superglue will:
Identify which integration to use (or create one if needed)
Find the relevant API endpoint from the documentation
Configure the API call with appropriate parameters
Test it and make it available for execution
Complex example:
Copy
Ask AI
"Create a tool that loops through all contacts in HubSpot,filters those with email domains matching @company.com,and updates their lifecycle stage to 'customer'"
Go to Tools in your superglue dashboard and click “Create Tool”
2
Select integrations
Choose which API integrations this tool will use
3
Add instruction
Describe what the tool should do in natural language. superglue will build the workflow steps automatically.
4
Test and save
Run the tool with sample data to verify it works as expected. See debugging tools for troubleshooting.
For programmatic tool creation, use the SDK:
Copy
Ask AI
npm install @superglue/client
Build a tool with natural language:
SDK
GraphQL
Copy
Ask AI
import { SuperglueClient } from "@superglue/client";const superglue = new SuperglueClient({ apiKey: "your_api_key_here"});// Let superglue build the workflow from your instructionconst tool = await superglue.buildWorkflow({ integrationIds: ["stripe"], instruction: "Fetch all active customers from Stripe"});console.log(tool); // Tool with auto-generated steps
Copy
Ask AI
mutation BuildWorkflow { buildWorkflow( integrationIds: ["stripe"] instruction: "Fetch all active customers from Stripe" ) { id instruction steps { id integrationId apiConfig { method urlPath } } finalTransform }}
Build and execute a tool with natural language:
SDK
GraphQL
Copy
Ask AI
// Build the workflow from natural languageconst tool = await superglue.buildWorkflow({ integrationIds: ["hubspot"], instruction: `Get all contacts from HubSpot where the email domain is @company.com and update their lifecycle stage to 'customer'`});// Test it with sample dataconst result = await superglue.executeWorkflow({ workflow: tool, payload: {}});console.log(result); // { success: true, data: { updated: 5, contacts: [...] } }// Save it for reuseawait superglue.upsertWorkflow({ ...result.config, id: "update-company-contacts"});
Copy
Ask AI
# Step 1: Build the workflowmutation BuildWorkflow { buildWorkflow( integrationIds: ["hubspot"] instruction: """ Get all contacts from HubSpot where the email domain is @company.com and update their lifecycle stage to 'customer' """ ) { id steps { id integrationId apiConfig { method urlPath body } } finalTransform }}# Step 2: Execute the workflowmutation ExecuteWorkflow($workflow: WorkflowInput!) { executeWorkflow( workflow: $workflow payload: {} ) { success data config { id steps { id } } }}# Step 3: Save for reusemutation SaveWorkflow($workflow: WorkflowInput!) { upsertWorkflow(workflow: $workflow) { id instruction }}
JavaScript expressions must use the arrow function syntax (sourceData) => .... Direct property access like <<userId>> works for simple variables, but not for nested properties or transformations.
{ id: "queryDatabase", integrationId: "postgres_db", apiConfig: { urlHost: "postgres://<<postgres_db_username>>:<<postgres_db_password>>@<<postgres_db_hostname>>:5432", urlPath: "<<postgres_db_database>>", body: { query: "SELECT * FROM users WHERE status = $1 AND created_at > $2", params: ["active", "<<(sourceData) => sourceData.startDate>>"] } }}
Always use parameterized queries with $1, $2, etc. placeholders to prevent SQL injection. Provide values in the params array, which can include static values or <<>> expressions.
Failed steps are automatically retried with exponential backoff
Self-healing
When enabled, superglue attempts to fix configuration errors automatically
Validation
Response data is validated against expected schemas
Graceful degradation
Handle missing data with optional chaining and defaults in transformations
Keep steps focused - Each step should make a single API call. Use transformations to prepare data, not additional steps.Use descriptive IDs - Step IDs are used to reference data in later steps. Use clear names like getCustomers, updateOrder, sendEmail.Avoid unnecessary loops - Don’t loop over thousands of items if the API supports batch operations. Check the documentation first.Test with real data - Test each step incrementally with production-like data before deploying.