## Introduction
Automating the generation of release documentation is a significant productivity booster for product teams, developers, and release managers in startups and technology companies. Manual compilation of release notes, changelogs, and deployment summaries is time-consuming and error-prone, often leading to outdated or incomplete documents that impair communication across engineering, product, and customer-facing teams.
This guide focuses on creating an automation workflow using **n8n**, an open-source workflow automation tool that enables you to connect apps and automate tasks via visual workflows. We will demonstrate how to build a robust pipeline that automatically collects data from your version control system (e.g., GitHub), aggregates issues and pull requests linked to a release, compiles this information into a well-structured release document, and outputs the final document into Google Docs or Notion. This automation not only saves time but ensures consistency, accuracy, and timely release communication.
### Who Benefits
– **Product Managers and Release Managers**: Spend less time gathering information and more time on planning.
– **Developers**: No need to manually summarize PRs and issues; automated notes ensure credit and clarity.
– **Operations and Customer Support**: Get consistent, easy-to-digest release notes aligned with deployed versions.
## Tools and Services Integrated
– **n8n**: Workflow automation platform.
– **GitHub API**: To fetch pull requests, commits, and issues related to a release.
– **Google Docs or Notion API**: To create and update release documentation.
– **Slack (optional)**: To notify teams that new release notes are available.
—
## Step-by-Step Technical Tutorial
### Overview of the Workflow
1. **Trigger**: Manual trigger or webhook indicating a new release version.
2. **Fetch Release Data**: Use GitHub API to get the release tag, associated commits, PRs, and issues.
3. **Aggregate and Format Content**: Process the data to generate structured content.
4. **Create/Update Documentation**: Push the formatted release notes to Google Docs or Notion.
5. **Notify Team (optional)**: Send a Slack message with the document link.
—
### Prerequisites
– n8n installed or access to [n8n.cloud](https://n8n.io/cloud).
– GitHub Personal Access Token with repo scopes.
– Google Cloud Project credentials with Google Docs API enabled (OAuth credentials).
– Slack Bot Token (optional).
### Detailed Workflow Construction
#### Step 1: Set the Trigger
– Use the **Manual Trigger** node in n8n if you want to trigger on-demand.
– Alternatively, use the **Webhook Trigger** node to activate the workflow automatically when a new release is published (GitHub webhook).
Configuration:
– If using webhook, configure GitHub release webhook to point to the n8n webhook URL.
– The payload provides the release tag and information.
#### Step 2: Retrieve Release Information from GitHub
– Add a **HTTP Request** node configured to call GitHub API endpoints:
– **Get release details**: `GET /repos/{owner}/{repo}/releases/tags/{tag}`
– Extract release tag, name, and description.
– Next, retrieve the list of commits for the release:
– Depending on your workflow, fetch commits using:
`GET /repos/{owner}/{repo}/compare/{previous_tag}…{current_tag}`
– This returns a list of commits between two release tags.
– To fetch pull requests associated with those commits:
– Iterate commits and call `GET /repos/{owner}/{repo}/pulls?head={commit_sha}`
– Alternatively, use GitHub’s GraphQL API to query PRs merged between tags.
– Fetch issues linked to the release by extracting issue numbers mentioned in PRs or commits.
Technical tips:
– Use n8n’s **Function** node to help parse and extract commit SHAs.
– Use **SplitInBatches** node to iterate over multiple commits or PRs to avoid API rate limits.
#### Step 3: Aggregate and Format Release Notes
– Use a **Function** node to process fetched data:
– Group PRs by labels (feature, bug, docs, etc.).
– Format information for each PR and issue: title, author, link.
– Prepend headers (e.g., “### Features”, “### Bug Fixes”).
Example JavaScript snippet in Function node:
“`javascript
const prs = items.map(item => {
return `- ${item.json.title} ([#${item.json.number}](${item.json.html_url})) by @${item.json.user.login}`;
});
return [{json: {releaseNotes: prs.join(‘\n’)}}];
“`
– You can use markdown formatting as target platforms like Google Docs or Notion support styled content.
#### Step 4: Create or Update Google Docs / Notion Release Document
**For Google Docs:**
– Add a **Google Docs** node and authorize with your Google credentials.
– Choose to **Create a new document** or **Append content** to an existing template document.
– Use the release notes content from the previous step to fill the document.
– Optionally, use placeholders in a template document and replace them with the release notes using the Google Docs API and an HTTP node if n8n’s Google Docs node doesn’t support text replacement.
**For Notion:**
– Use the **Notion** node.
– Create a new page or update an existing page in a specific database or workspace.
– Format the release notes using Notion blocks (paragraph blocks, headings, etc.).
#### Step 5: Notify Team via Slack (Optional)
– Add a **Slack** node.
– Configure to send a message to a channel/DM.
– Message content example:
“New release v{{releaseTag}} notes are ready: [Link to Google Doc/Notion]”
—
## Common Errors and Tips for Robustness
– **GitHub API Rate Limits**: Use authenticated requests to increase thresholds.
– **Pagination Handling**: GitHub API paginates results; ensure your HTTP nodes handle paging.
– **Error Handling**: Use n8n’s error workflow triggers to retry or alert in case of failures.
– **Authorization Token Expiry**: Regularly refresh OAuth tokens for Google and Slack.
– **Data Consistency**: Verify that release tags align exactly with GitHub tags.
– **Webhook Validation**: Verify GitHub webhook payload signatures to avoid spoofed triggers.
Tips:
– Use **SplitInBatches** nodes to avoid hitting request limits and allow smooth iteration.
– Store previous release tag in an environment variable or a database node to compare commits between releases.
– Schedule manual reviews post automation during initial rollout to validate accuracy.
—
## Scaling and Adaptations
– **Multiple Repositories:** Extend the workflow to iterate through multiple repositories by using a list of repo metadata.
– **Extended Integrations:** Pull ticket details from JIRA or linear if issues are managed there, and incorporate those into notes.
– **Automated Release Deployment:** Chain this workflow after CI/CD pipelines to trigger documentation generation only on successful releases.
– **Localization:** Add functionality to create release notes in multiple languages by integrating translation APIs.
## Summary
By automating your release documentation with n8n, you create a repeatable, reliable, and fast process that improves communication across your startup’s product lifecycle. The workflow smoothly connects GitHub, documentation platforms like Google Docs or Notion, and optionally Slack, reducing manual labor and error. Start by setting up webhook or manual triggers, craft API calls to fetch necessary release data, process it into human-readable content, and finally deliver it to your teams.
—
### Bonus Tip: Template Version Control
Maintain your release document templates under version control (e.g., in your repo or Google Drive). You can automate pulling the latest template into your workflow, ensuring your release notes always adhere to updated style and content guidelines without manual edits.