by jon 

Create Atlassian Confluence page from template

0 Comments

Overview

This n8n workflow is designed to automate the creation of pages in Atlassian Confluence based on a predefined template. It leverages the flexibility of n8n's HTTP request nodes to interact with Confluence's API, allowing for dynamic page creation based on parameters provided through a webhook trigger. This is particularly useful for teams that frequently need to generate similar pages in Confluence, such as meeting notes, project reports, or any other repeatable content.

How the Workflow Works

The workflow consists of several key steps:

  1. Webhook Trigger:

    • The workflow starts with a Webhook node. When an external system or user sends a POST request to the webhook's URL, it triggers the workflow. This request can include various parameters that will be used later in the workflow.
  2. Setting Parameters:

    • The Set parameters node stores the Confluence base URL, template ID, target space key, and parent page ID. These are essential for making the API requests to Confluence. These values can be customized according to your Confluence setup.
  3. Get Template Content from Confluence:

    • The Confluence: Get template content node uses the stored parameters to fetch the template content from Confluence. This is done via an HTTP GET request to Confluence's API, using basic authentication.
  4. Replace Placeholders in Template:

    • The Replace placeholders in template body and title node processes the fetched template. It replaces placeholders in the template's title and body with values provided in the initial webhook request. This allows the generated page to be customized with dynamic content.
  5. Create Page in Confluence:

    • The Confluence: Create page from template node takes the processed title and body and sends an HTTP POST request to create a new page in Confluence. The page is created under the specified parent page and within the designated space.
  6. Sticky Note for Setup Instructions:

    • Sticky Note is included in the workflow for documentation purposes, providing a brief overview of the workflow setup and credentials needed.

Adapting the Workflow to Your Needs

This workflow is flexible and can be customized in several ways:

  1. Webhook Payload:

    • Modify the payload sent to the webhook to include different or additional parameters that can be used to further customize the Confluence pages.
  2. Template and Space Details:

    • Update the Set parameters node to match your Confluence environment. Change the template_idtarget_space_key, and target_parent_page_id to reflect the templates and spaces you want to use.
  3. Placeholder Replacement:

    • Customize the Replace placeholders in template body and title node to handle additional or different placeholders. You can modify the JavaScript code to process complex or nested placeholder structures.
  4. Authentication:

    • Ensure the Confluence: Get template content and Confluence: Create page from template nodes are configured with valid Confluence credentials. You'll need to use an API token for authentication, as detailed in the workflow's Sticky Note.

About the author 

jon

With over 20 years of experience in software development, product management, and business leadership, I specialize in optimizing and scaling business processes through innovative automation and advanced AI technologies.

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
Subscribe to get the latest updates