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:
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.
- The workflow starts with a
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.
- The
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.
- The
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.
- The
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.
- The
Sticky Note for Setup Instructions:
- A
Sticky Note
is included in the workflow for documentation purposes, providing a brief overview of the workflow setup and credentials needed.
- A
Adapting the Workflow to Your Needs
This workflow is flexible and can be customized in several ways:
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.
Template and Space Details:
- Update the
Set parameters
node to match your Confluence environment. Change thetemplate_id
,target_space_key
, andtarget_parent_page_id
to reflect the templates and spaces you want to use.
- Update the
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.
- Customize the
Authentication:
- Ensure the
Confluence: Get template content
andConfluence: 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.
- Ensure the