convex-functions

Build and validate Convex server functions with validators and error handling.

1|1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/mauricioacp/tanstack-convex-better-auth-template --skill convex-functions-mauricioacp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-functions
Source: https://github.com/mauricioacp/tanstack-convex-better-auth-template/tree/main/.agents/skills/convex-functions
Command: npx skills add https://github.com/mauricioacp/tanstack-convex-better-auth-template --skill convex-functions-mauricioacp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Convex Functions to confidently implement server-side logic with strong validation, error handling, and secure internal function usage across queries, mutations, actions, and HTTP endpoints.

Core Features & Use Cases

  • Queries: reactive read-only access with validators and indexing.
  • Mutations: transactional writes with validation and safe error handling.
  • Actions: external API calls with integration patterns and error handling.
  • HTTP Actions: webhooks and HTTP endpoints with typed inputs/returns.
  • Internal Functions: restricted access for sensitive operations and reusability.
  • Scheduling & orchestration: support for scheduled tasks and workflows.

Quick Start

Instantiate the Convex Functions skill by creating a project and implementing sample queries, mutations, actions, and HTTP endpoints with proper validators.

Frequently Asked Questions about convex-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Convex mutation with input validation and error handling?

Convex mutations use strict input validators to enforce data integrity during transactional writes, ensuring that invalid data triggers safe error handling before any database modifications occur. This prevents partial updates and maintains consistency across your production application.

What is the difference between Convex queries and actions for backend logic?

Convex queries provide reactive read-only access to your database, while actions handle external API calls and complex asynchronous workflows. Queries are optimized for real-time data retrieval, whereas actions integrate with third-party services and manage side effects outside the Convex transaction environment.

How do I set up HTTP endpoints in Convex for incoming webhooks?

Setting up Convex HTTP actions allows you to expose HTTP endpoints for incoming webhooks by defining typed inputs and returns. These endpoints process external HTTP requests securely, enabling integration with external services while maintaining strict validation on all incoming payloads.

Can I schedule tasks and orchestrate workflows using Convex functions?

Yes, you can schedule tasks and orchestrate workflows using Convex actions, which support scheduled execution for recurring jobs and complex multi-step processes. This enables reliable automation of background tasks, external API polling, and time-delayed operations within your application.

When should I use internal functions in a production Convex application?

Use internal Convex functions when you need restricted access for sensitive operations or want to reuse logic across queries, mutations, and actions without exposing endpoints publicly. They enforce security boundaries by ensuring only other backend functions can invoke them, protecting privileged workflows.

Does Convex support typed inputs and outputs for HTTP actions?

Yes, Convex HTTP actions support typed inputs and returns, allowing you to define strict validators for incoming HTTP requests and outgoing responses. This ensures end-to-end type safety for webhooks and external integrations, preventing malformed data from disrupting your server logic.