Cursor
Build workflows with Cursor AI Agents and track usage
Actions
Section titled “Actions” Get Daily Usage Data Fetches daily team usage metrics from Cursor's Admin API.
Get Last Message Retrieves the last message from a Cursor Cloud Agent conversation.
Launch Cloud Agent Launches a Cursor Cloud Agent to perform coding tasks asynchronously.
Instructions
Section titled “Instructions”To get your API keys, visit the Cursor Dashboard. You may need separate keys for Agents and Admin features.
Get Daily Usage Data
Section titled “Get Daily Usage Data”The Get Daily Usage Data component fetches team usage metrics from Cursor’s Admin API.
Use Cases
Section titled “Use Cases”- Usage reporting: Track team productivity and AI usage patterns
- Cost tracking: Monitor usage-based requests and subscription consumption
- Analytics dashboards: Build custom dashboards with Cursor usage data
How It Works
Section titled “How It Works”- Fetches usage data for the specified date range from Cursor’s Admin API
- Returns detailed metrics per user including lines added/deleted, requests, and model usage
Configuration
Section titled “Configuration”- Start Date: Start of the date range (YYYY-MM-DD format, defaults to 7 days ago)
- End Date: End of the date range (YYYY-MM-DD format, defaults to today)
Output
Section titled “Output”The output includes per-user daily metrics:
- Lines added/deleted (total and accepted)
- Tab completions shown/accepted
- Composer, chat, and agent requests
- Subscription vs usage-based request counts
- Most used model and file extensions
- Requires a valid Cursor Admin API key configured in the integration
- Only returns data for active users
Example Output
Section titled “Example Output”{ "data": [ { "acceptedLinesAdded": 1102, "acceptedLinesDeleted": 645, "agentRequests": 12, "chatRequests": 128, "composerRequests": 45, "date": 1710720000000, "email": "developer@company.com", "isActive": true, "mostUsedModel": "gpt-4", "subscriptionIncludedReqs": 180, "totalAccepts": 73, "totalApplies": 87, "totalLinesAdded": 1543, "totalLinesDeleted": 892, "totalRejects": 14, "totalTabsAccepted": 289, "totalTabsShown": 342, "usageBasedReqs": 5 } ], "period": { "endDate": 1710892800000, "startDate": 1710720000000 }}Get Last Message
Section titled “Get Last Message”The Get Last Message component retrieves the last message from a Cursor Cloud Agent’s conversation history.
Use Cases
Section titled “Use Cases”- Message tracking: Get the latest response or prompt from an agent conversation
- Workflow automation: Use the last message as input for downstream components
- Status monitoring: Check what the agent last communicated
How It Works
Section titled “How It Works”- Fetches the conversation history for the specified agent ID
- Extracts the last message from the conversation
- Returns the message details including ID, type (user_message or assistant_message), and text
Configuration
Section titled “Configuration”- Agent ID: The unique identifier for the cloud agent (e.g., bc_abc123)
Output
Section titled “Output”The output includes:
- Agent ID: The identifier of the agent
- Message: The last message object containing:
- ID: Unique message identifier
- Type: Either “user_message” or “assistant_message”
- Text: The message content
- Requires a valid Cursor Cloud Agent API key configured in the integration
- If the agent has been deleted, the conversation cannot be accessed
- Returns nil if the conversation has no messages
Example Output
Section titled “Example Output”{ "agentId": "bc_abc123", "message": { "id": "msg_005", "text": "I've added a troubleshooting section to the README.", "type": "assistant_message" }}Launch Cloud Agent
Section titled “Launch Cloud Agent”The Launch Cloud Agent component triggers a Cursor AI coding agent and waits for it to complete.
Use Cases
Section titled “Use Cases”- Automated code generation: Generate code from natural language prompts
- PR fixes: Automatically fix issues on existing pull requests
- Code refactoring: Refactor code based on instructions
- Feature implementation: Implement new features from specifications
How It Works
Section titled “How It Works”- Launches a Cursor Cloud Agent with the specified prompt and configuration
- Waits for the agent to complete (monitored via webhook and polling)
- Emits output with the agent result (success or failure)
Example Output
Section titled “Example Output”{ "agentId": "agent_12345", "branchName": "cursor/agent-550e8400", "prUrl": "https://github.com/org/repo/pull/42", "status": "done", "summary": "Refactored login logic."}