Automate Blog Publishing from Airtable to Hashnode via GraphQL API - n8n Workflow

Use this robust n8n workflow to automatically fetch unpublished blog content from Airtable and create corresponding drafts on Hashnode using GraphQL API calls. An essential n8n template for content teams.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content creators and marketing teams managing multiple Hashnode publications.
Users seeking a robust n8n workflow to sync content from Airtable databases.
Developers requiring an automated, API-driven technical blog publishing process.
Agencies managing client content across various Hashnode accounts using a centralized database.

Overview

Managing a content pipeline manually, especially when dealing with multiple publications, can be time-consuming and error-prone. This specialized n8n workflow solves this by establishing a reliable, automated bridge between your content database in Airtable and your Hashnode publication platform.

The automation ensures that only posts marked as 'Not Published' are processed. It uses complex GraphQL requests via the HTTP Request n8n node to fetch publication details and create drafts, adding a layer of sophisticated technical integration often required in advanced n8n templates. Furthermore, it includes crucial conditional logic to handle missing publication IDs and updates the status back in Airtable, providing a fully closed-loop content management system.

How it Works

This efficient n8n workflow executes in a streamlined, seven-step process, starting with a user-initiated n8n trigger:


  1. Manual Execution: The workflow begins with the 'When clicking ‘Execute workflow’' n8n trigger, allowing the user to initiate the publishing cycle on demand.

  2. Retrieve Posts (Airtable n8n node): The workflow connects to Airtable to search for all records where the Status field is marked as 'Not Published'.

  3. Process Batches (Loop Over Items): The 'Loop Over Items' n8n node processes each retrieved post individually, ensuring that errors in one post do not halt the entire batch.

  4. Fetch Publication ID: An HTTP Request n8n node calls the Hashnode GraphQL API to dynamically retrieve the specific publicationId using the domain provided in the Airtable record, authenticated by the Hashnode_Token.

  5. Validate Publication: An IF n8n node checks if the required publicationId was successfully retrieved. If the ID exists (True path), the workflow proceeds to post creation. If it fails (False path), it marks the Airtable record as 'Error'.

  6. Create Draft (HashNode Post Draft): If validated, a second HTTP Request n8n node sends a GraphQL mutation to Hashnode, using the title, content markdown, and publication ID to create a new draft post.

  7. Update Status (Update Post): Upon successful draft creation, the final Airtable n8n node updates the original record's Status to 'Published', completing the full cycle of this powerful n8n workflow.

Installation Guide

To deploy this specialized n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON code and import it into your n8n instance via the 'Workflows' section using the 'New' -> 'Import from JSON' option.

  2. Configure Credentials: You must configure credentials for the Airtable n8n node and manage the Hashnode API authentication directly within the HTTP Request nodes.

  3. Airtable Setup:

Select the correct Base and Table in the 'Get Posts' and 'Update Post' n8n nodes.
Ensure your Airtable table contains the necessary columns: Title, Contentmarkdown, HashnodeToken, HashNodePublicationDomain, and Status.

  1. HTTP Request Node Configuration: The GraphQL queries dynamically retrieve data from the Airtable item, including the HashnodeToken and HashNodePublication_Domain. Ensure these fields are mapped correctly in both HTTP Request n8n nodes ('Get Publication ID' and 'HashNode Post Draft').

  2. Testing: Use the 'When clicking ‘Execute workflow’' n8n trigger to manually test the process with a single 'Not Published' record.

Node Details

When clicking ‘Execute workflow’ (Manual Trigger n8n node): This acts as the initiating n8n trigger, starting the entire publishing process manually.
Get Posts (Airtable n8n node): Function: Searches and retrieves records from a specified Airtable table where the Status column equals "Not Published". Key Configuration: Operation is search, filtered by filterByFormula: "={Status} = \"Not Published\"".
Loop Over Items (Split In Batches n8n node): Function: Ensures that if multiple blog posts are retrieved by the Airtable n8n node, they are processed sequentially, one item at a time, preventing API rate limit issues and simplifying data mapping.
Get Publication ID (HTTP Request n8n node): Function: Queries the Hashnode GraphQL API to obtain the publication ID necessary for creating the draft. Key Configuration: Uses POST method, GraphQL query, and an Authorization header dynamically pulling the HashnodeToken and HashNodePublicationDomain from the current item.
If Exists PublicationID (IF n8n node): Function: Implements crucial flow control. It verifies the existence of the publication ID retrieved in the previous step, directing the flow to success (HashNode Post Draft) or failure (Update Error).
HashNode Post Draft (HTTP Request n8n node): Function: Creates the draft post on Hashnode. Key Configuration: Uses a GraphQL mutation (CreateDraft) and maps the Title and Content_markdown fields from the Airtable data payload.


  • Update Post / Update Error (Airtable n8n node): Function: Updates the status of the original record in Airtable to either 'Published' (success) or 'Error' (failure). Key Configuration: Operation is update, using the Airtable record id to specify which record to modify.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

AI Systems Architect with 18+ years experience designing scalable, intelligent automation solutions. I specialize in architecting complex n8n workflows that integrate AI systems, streamline operations, and optimize business processes. My expertise spans multi-agent architectures, data automation, and enterprise-grade systems that adapt to evolving business needs. I help organizations unlock their potential through strategic technology implementation and innovative automation solutions.

Featured*