Create a Calendly availability API endpoint for real-time scheduling data
This n8n template implements a Calendly Availability Checker that provides real-time availability information for your Calendly event types via a simple API endpoint
Who's it for
This template is designed for developers, businesses, and service providers who need to programmatically check Calendly availability. It's perfect for:
- Web developers building custom booking interfaces that need real-time availability data
- Chatbot developers who want to suggest available times to users
- Website builders who want to display available slots on their site
- Integration developers who need to check availability before creating bookings
- Businesses that want to build custom scheduling experiences on top of Calendly
- Service providers who need availability data for their own applications or dashboards
How it works / What it does
This workflow creates a RESTful API endpoint that returns real-time availability information from your Calendly account. The system:
-
Accepts webhook requests via POST with optional parameters:
event_type_uri(optional) - Specific event type to checkdays_ahead(optional, default: 7) - Number of days to check ahead
-
Authenticates with Calendly API using OAuth2 credentials to access your account
-
Retrieves user information to get your Calendly user URI and account details
-
Lists all active event types from your Calendly account
-
Selects the target event type:
- Uses the
event_type_urifrom the request if provided - Otherwise defaults to the first active event type
- Uses the
-
Fetches available time slots from Calendly's availability API for the specified date range
-
Formats the availability data into a structured response including:
- Total number of available slots
- Next available slot (formatted and ISO timestamp)
- Array of all available slots with formatted times and booking URLs
- Slots grouped by day for easy consumption
- Complete list of all event types
-
Returns a comprehensive JSON response with all availability information ready for integration
How to set up
1. Configure Calendly OAuth2 Credentials
- Go to calendly.com/integrations
- Click "API & Webhooks"
- Create an OAuth2 application or use Personal Access Token
- In n8n, create a new credential:
- Type: "Calendly OAuth2 API"
- Follow the OAuth flow to connect your Calendly account
- The credential will be used by all HTTP Request nodes in the workflow
2. Activate the Workflow
- Open the workflow in n8n
- Ensure the Calendly OAuth2 credential is properly configured
- Activate the workflow to make the webhook endpoint available
3. Test the Workflow
- Use the "Test workflow" button in n8n to manually trigger it
- Or send a POST request to the webhook URL:
{ "event_type_uri": "optional-event-uri", "days_ahead": 7 } - Verify the response contains availability data
- Check that the "Get Current User" node successfully retrieves your account info
4. Customize (Optional)
- Adjust the default
days_aheadvalue in the "Set Configuration" node (currently 7 days) - Modify the date range calculation in "Get Available Times" node
- Customize the response format in "Respond with Availability" node
- Add filtering logic to select specific event types
- Add caching to reduce API calls
Requirements
- Calendly account with at least one active event type
- n8n instance (self-hosted or cloud)
- Calendly OAuth2 API credentials configured in n8n
- Webhook access (if using n8n cloud, webhooks are automatically available)
How to customize the workflow
Modify Date Range
- Edit the "Set Configuration" node to change the default
days_aheadvalue - Update the
start_timeandend_timecalculations in "Get Available Times" node - Currently checks from tomorrow (1 day ahead) to 7 days ahead by default
- Adjust the date calculation expressions as needed
Filter Specific Event Types
- Modify the "Select Event Type" node to add filtering logic
- Add an IF node to check event type names or slugs
- Filter by duration, active status, or custom criteria
- Return multiple event types if needed
Customize Response Format
- Edit the "Respond with Availability" node to change the JSON structure
- Add or remove fields from the response
- Format dates/times differently
- Include additional metadata from event types
- Add pagination for large slot lists
Add Caching
- Insert a Code node before "Get Available Times" to check cache
- Store availability data temporarily to reduce API calls
- Set appropriate cache expiration times
- Consider using n8n's built-in cache or external storage
Add Error Handling
- Enhance error handling in HTTP Request nodes
- Add validation for request parameters
- Return meaningful error messages in the response
- Handle cases where no event types exist
- Handle cases where no availability exists
Integrate with Other Services
- Add nodes to log availability checks to a database
- Send availability data to analytics platforms
- Trigger notifications when availability changes
- Sync availability with external calendars
- Build availability dashboards
Key Features
- RESTful API endpoint - Simple POST endpoint for checking availability
- Real-time availability - Fetches current availability directly from Calendly API
- Flexible event type selection - Supports specific event type or auto-selects first available
- Configurable date range - Customizable number of days to check ahead
- Comprehensive response format - Returns formatted and raw availability data
- Multiple data views - Provides slots as array, grouped by day, and summary statistics
- Event type information - Includes details about all available event types
- Human-readable formatting - Formats dates and times for easy display
- Booking URLs included - Each slot includes direct booking URL
- Error resilience - Nodes configured with
continueRegularOutputto handle API errors gracefully
Use Cases
- Custom booking widgets - Display available slots on your website without embedding Calendly
- Chatbot integration - Let AI assistants suggest available times to users
- Mobile app integration - Check availability before showing booking options in mobile apps
- Multi-calendar systems - Aggregate availability from multiple Calendly accounts
- Availability dashboards - Build internal dashboards showing team availability
- Smart scheduling - Check availability before sending meeting invitations
- Booking confirmation flows - Verify availability before processing bookings
- Calendar sync verification - Ensure Calendly availability matches other calendar systems
- Analytics and reporting - Track availability patterns and booking trends
- Custom scheduling UIs - Build completely custom scheduling interfaces using availability data
Data Fields Returned
User Information
- User name, email, scheduling URL
- User URI and organization URI
Event Type Information
- Event type name, duration (minutes), URI
- Complete list of all active event types with details
Availability Summary
has_slots- Boolean indicating if any slots are availabletotal_slots- Total number of available slotsnext_available- Human-readable formatted string of next available slotnext_available_iso- ISO 8601 timestamp of next available slot
Available Slots Array
Each slot includes:
start_time- ISO 8601 timestampformatted- Human-readable date/time stringbooking_url- Direct URL to book this specific slot
Slots by Day
- Grouped object with days as keys
- Each day contains array of time slots with formatted times and booking URLs
- Format:
{ "Monday, Dec 2": [{ time: "10:00 AM", url: "..." }] }
Metadata
checked_at- ISO timestamp of when availability was checkedsuccess- Boolean indicating successful execution
Workflow Architecture
The workflow uses a linear processing pattern with data transformation at each step:
- Webhook Trigger → Receives POST requests with optional parameters
- Set Configuration → Extracts and sets default values for
event_type_urianddays_ahead - Get Current User → Authenticates and retrieves Calendly user information
- Extract User Info → Parses user data to extract URIs and account details
- Get Event Types → Fetches all active event types for the user
- Select Event Type → Chooses target event type (from request or first available)
- Get Available Times → Queries Calendly API for available time slots
- Format Availability → Transforms raw API data into structured, formatted response
- Respond with Availability → Returns comprehensive JSON response to caller
Example Scenarios
Scenario 1: Check Default Availability
- Developer sends POST request to webhook endpoint with empty body
- Workflow uses default 7-day lookahead period
- Workflow selects first active event type automatically
- Returns availability for next 7 days with all slots formatted
- Developer displays slots in custom booking interface
Scenario 2: Check Specific Event Type
- Developer sends POST request with specific
event_type_uri - Workflow uses provided event type instead of default
- Checks availability for that specific event type only
- Returns slots grouped by day for easy calendar display
- Developer shows availability in day-by-day calendar view
Scenario 3: Extended Date Range
- Developer sends POST request with
days_ahead: 30 - Workflow checks availability for next 30 days
- Returns comprehensive list of all available slots
- Developer uses data to show monthly availability view
- User can see all available times for the next month
Scenario 4: Chatbot Integration
- User asks chatbot "When are you available?"
- Chatbot calls webhook endpoint to get availability
- Workflow returns next available slot and total count
- Chatbot responds: "I have 15 slots available. Next available: Monday, Dec 2 at 10:00 AM"
- Chatbot offers to book the next available slot
This template provides a powerful API endpoint for checking Calendly availability, enabling developers to build custom scheduling experiences while leveraging Calendly's robust scheduling infrastructure.
n8n Calendly Availability API Endpoint
This n8n workflow creates a custom API endpoint that can be used to query Calendly availability. It acts as a proxy, receiving requests, making a call to the Calendly API, and then responding with the retrieved data.
Description
This workflow simplifies the process of integrating Calendly availability data into other applications or services. Instead of directly calling the Calendly API from your external application, you can send a request to this n8n webhook, which then handles the communication with Calendly and returns the results. This can be useful for abstracting API keys, adding custom logic, or combining data from multiple sources before responding.
What it does
- Listens for incoming requests: The workflow is triggered by an HTTP POST request to its custom webhook URL.
- Makes an HTTP Request to Calendly: It then performs an HTTP GET request to the Calendly API to fetch availability data.
- Transforms the data (Optional): Although not explicitly configured in the provided JSON, the "Edit Fields (Set)" node is present, suggesting an intended step to modify or filter the data received from Calendly before it's returned.
- Responds to the original webhook: Finally, it sends the processed data back as a response to the initial incoming request.
Prerequisites/Requirements
- n8n Instance: A running instance of n8n.
- Calendly Account: An active Calendly account.
- Calendly API Key: You will need a Calendly API key to authenticate the HTTP Request node. This should be configured as a credential within n8n.
Setup/Usage
- Import the workflow: Import the provided JSON into your n8n instance.
- Configure Calendly API Key:
- Find the "HTTP Request" node (ID: 19).
- Configure the Calendly API endpoint and add your Calendly API key as a Bearer Token or other appropriate authentication method in the node's settings.
- Activate the Webhook: The "Webhook" node (ID: 47) will provide a unique URL once the workflow is activated.
- Trigger the workflow: Send an HTTP POST request to the webhook URL provided by the "Webhook" node. The workflow will then execute, fetch data from Calendly, and respond with the results.
- Customize Data Transformation: If you need to modify or filter the Calendly data, configure the "Edit Fields (Set)" node (ID: 38) to perform the desired transformations.
Related Templates
Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets
This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.
Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax
Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions
Automate invoice processing with OCR, GPT-4 & Salesforce opportunity creation
PDF Invoice Extractor (AI) End-to-end pipeline: Watch Drive ➜ Download PDF ➜ OCR text ➜ AI normalize to JSON ➜ Upsert Buyer (Account) ➜ Create Opportunity ➜ Map Products ➜ Create OLI via Composite API ➜ Archive to OneDrive. --- Node by node (what it does & key setup) 1) Google Drive Trigger Purpose: Fire when a new file appears in a specific Google Drive folder. Key settings: Event: fileCreated Folder ID: google drive folder id Polling: everyMinute Creds: googleDriveOAuth2Api Output: Metadata { id, name, ... } for the new file. --- 2) Download File From Google Purpose: Get the file binary for processing and archiving. Key settings: Operation: download File ID: ={{ $json.id }} Creds: googleDriveOAuth2Api Output: Binary (default key: data) and original metadata. --- 3) Extract from File Purpose: Extract text from PDF (OCR as needed) for AI parsing. Key settings: Operation: pdf OCR: enable for scanned PDFs (in options) Output: JSON with OCR text at {{ $json.text }}. --- 4) Message a model (AI JSON Extractor) Purpose: Convert OCR text into strict normalized JSON array (invoice schema). Key settings: Node: @n8n/n8n-nodes-langchain.openAi Model: gpt-4.1 (or gpt-4.1-mini) Message role: system (the strict prompt; references {{ $json.text }}) jsonOutput: true Creds: openAiApi Output (per item): $.message.content → the parsed JSON (ensure it’s an array). --- 5) Create or update an account (Salesforce) Purpose: Upsert Buyer as Account using an external ID. Key settings: Resource: account Operation: upsert External Id Field: taxid_c External Id Value: ={{ $json.message.content.buyer.tax_id }} Name: ={{ $json.message.content.buyer.name }} Creds: salesforceOAuth2Api Output: Account record (captures Id) for downstream Opportunity. --- 6) Create an opportunity (Salesforce) Purpose: Create Opportunity linked to the Buyer (Account). Key settings: Resource: opportunity Name: ={{ $('Message a model').item.json.message.content.invoice.code }} Close Date: ={{ $('Message a model').item.json.message.content.invoice.issue_date }} Stage: Closed Won Amount: ={{ $('Message a model').item.json.message.content.summary.grand_total }} AccountId: ={{ $json.id }} (from Upsert Account output) Creds: salesforceOAuth2Api Output: Opportunity Id for OLI creation. --- 7) Build SOQL (Code / JS) Purpose: Collect unique product codes from AI JSON and build a SOQL query for PricebookEntry by Pricebook2Id. Key settings: pricebook2Id (hardcoded in script): e.g., 01sxxxxxxxxxxxxxxx Source lines: $('Message a model').first().json.message.content.products Output: { soql, codes } --- 8) Query PricebookEntries (Salesforce) Purpose: Fetch PricebookEntry.Id for each Product2.ProductCode. Key settings: Resource: search Query: ={{ $json.soql }} Creds: salesforceOAuth2Api Output: Items with Id, Product2.ProductCode (used for mapping). --- 9) Code in JavaScript (Build OLI payloads) Purpose: Join lines with PBE results and Opportunity Id ➜ build OpportunityLineItem payloads. Inputs: OpportunityId: ={{ $('Create an opportunity').first().json.id }} Lines: ={{ $('Message a model').first().json.message.content.products }} PBE rows: from previous node items Output: { body: { allOrNone:false, records:[{ OpportunityLineItem... }] } } Notes: Converts discount_total ➜ per-unit if needed (currently commented for standard pricing). Throws on missing PBE mapping or empty lines. --- 10) Create Opportunity Line Items (HTTP Request) Purpose: Bulk create OLIs via Salesforce Composite API. Key settings: Method: POST URL: https://<your-instance>.my.salesforce.com/services/data/v65.0/composite/sobjects Auth: salesforceOAuth2Api (predefined credential) Body (JSON): ={{ $json.body }} Output: Composite API results (per-record statuses). --- 11) Update File to One Drive Purpose: Archive the original PDF in OneDrive. Key settings: Operation: upload File Name: ={{ $json.name }} Parent Folder ID: onedrive folder id Binary Data: true (from the Download node) Creds: microsoftOneDriveOAuth2Api Output: Uploaded file metadata. --- Data flow (wiring) Google Drive Trigger → Download File From Google Download File From Google → Extract from File → Update File to One Drive Extract from File → Message a model Message a model → Create or update an account Create or update an account → Create an opportunity Create an opportunity → Build SOQL Build SOQL → Query PricebookEntries Query PricebookEntries → Code in JavaScript Code in JavaScript → Create Opportunity Line Items --- Quick setup checklist 🔐 Credentials: Connect Google Drive, OneDrive, Salesforce, OpenAI. 📂 IDs: Drive Folder ID (watch) OneDrive Parent Folder ID (archive) Salesforce Pricebook2Id (in the JS SOQL builder) 🧠 AI Prompt: Use the strict system prompt; jsonOutput = true. 🧾 Field mappings: Buyer tax id/name → Account upsert fields Invoice code/date/amount → Opportunity fields Product name must equal your Product2.ProductCode in SF. ✅ Test: Drop a sample PDF → verify: AI returns array JSON only Account/Opportunity created OLI records created PDF archived to OneDrive --- Notes & best practices If PDFs are scans, enable OCR in Extract from File. If AI returns non-JSON, keep “Return only a JSON array” as the last line of the prompt and keep jsonOutput enabled. Consider adding validation on parsing.warnings to gate Salesforce writes. For discounts/taxes in OLI: Standard OLI fields don’t support per-line discount amounts directly; model them in UnitPrice or custom fields. Replace the Composite API URL with your org’s domain or use the Salesforce node’s Bulk Upsert for simplicity.