Opening Problem Statement
Meet David, a product manager juggling multiple projects across Notion for notes and Linear for issue tracking. Every week, he spends countless hours manually copying task details from his Notion design review notes into Linear as actionable issues. This tedious process wastes time, risks manual errors like missed assignee assignments or incorrectly formatted issue titles, and slows down the team’s development velocity.
David’s pain is specific: for every design review meeting, he might have 10-15 TODO items in Notion that need to become Linear issues. Manually transferring these slows down feedback cycles by hours per week and risks losing important context like the original Notion block link or the correct Linear assignee.
What This Automation Does
This n8n workflow automates the entire process of importing uncompleted TODO blocks from a specified Notion page and creating corresponding issues within a selected Linear team. Here’s what it accomplishes:
- Fetches team details from Linear based on team name selected via a simple form trigger.
- Retrieves all TODO blocks from the specified Notion page, filtering out already completed or imported items for accuracy.
- Extracts and processes the task title and assignee from the TODO block’s first line, shortening lengthy titles with GPT-4 AI prompts when needed.
- Creates issues in Linear with the correct team ID, assignee, shortened title, and a descriptive comment including a direct link back to the original Notion block for context.
- Adds a link back to the created Linear issue inside the original Notion TODO block, making cross-tool navigation seamless.
- Loops over multiple items if there are many tasks, ensuring batch efficiency.
By automating these steps, David saves hours weekly on manual data entry, eliminates potential errors, and keeps his team aligned quickly.
Prerequisites ⚙️
- n8n account to create and run the workflow. (Self-hosting optional with platforms like Hostinger for full control 🔐)
- Notion account with a setup page containing TODO blocks shared to an integration for API access 📁
- Linear account with API access for the team you want to create issues in 📊
- OpenAI API Key to enable GPT-4 based title shortening ⚙️
- API credentials set up in n8n for Notion, Linear GraphQL, and OpenAI nodes 🔑
Step-by-Step Guide
1. Start with the Form Trigger – Collect User Inputs
Navigate to your n8n editor and locate the n8n Form Trigger node. Configure it with these steps:
- Under Path, use a unique webhook path like
5a631d63-f899-4967-acad-69924674e96a. - Set the form title to “Import Linear issues from Notion”.
- Add two form fields: a
Notion page URL(required), and a dropdown forLinear team namewith options (e.g., AI, Adore, Payday, NODES). - This node waits for form submission, triggering the workflow.
You should see a user-submitted URL and team choice passed downstream on execution.
Common mistake: Not sharing your Notion page with your integration will cause a fetch failure later.
2. Fetch Linear Team Details using GraphQL
Add the Fetch Linear team details node using a GraphQL request configured as:
query GetTeamsAndProjects {
teams(filter: {name: {contains: "{{ $json['Linear team name'] }}"}}) {
nodes {
id
name
members {
nodes {
id
name
email
}
}
projects {
nodes {
id
name
description
}
}
}
}
}Set the Linear GraphQL endpoint URL to https://api.linear.app/graphql and authenticate with your API token.
This node pulls your team’s ID, members, and projects to be referenced later.
Expected outcome: You receive team details or trigger an error if the team is not found.
3. Handle Missing Team with Conditional Check
Use an If node named Team missing? to check if the query returned zero teams with this condition:
{{$json.data.teams?.nodes?.length < 1}If true, the workflow stops with a JSON error response showing that the team was not found.
4. Retrieve To-Do Items from the Notion Page
Next, use the Get issues Notion node and configure it to get all blocks from the Notion page URL passed by the trigger.
Then, filter these blocks with the Unimported, unchecked to_do blocks only node to exclude tasks that are already checked (complete) or those already imported (containing "[In Linear]" marker).
5. Process each To-Do Item Individually
The Loop Over Items Split In Batches node helps manage throughput of multiple to-dos.
Each TODO item is sent to the Set assignee and title Code node that uses JavaScript to:
- Extract the first line of the to-do’s text.
- Parse for a potential assignee in square brackets (e.g., [Omar]) at the start.
- Store the extracted assignee fragment and title.
- Find a matching team member from the Linear team list whose name starts with that assignee fragment.
Code snippet excerpt:
const regex = /^([[^]]*]s)?(.+)$/;
...
const matching_people = members.filter(p =>
p.name.toLowerCase().startsWith(item.json.assignee_fragment?.toLowerCase())
)This code ensures the correct assignee ID, used downstream for issue creation.
6. Shorten Titles Using GPT-4 OpenAI Node
If the task title is longer than 70 characters, the Shorten title AI node sends the title text to GPT-4 with a prompt to shorten it to under 150 characters, keeping original if already short.
Example prompt:
Make the following text more concise, so that it's max 150 chars long. If it's already less than 70 chars long, just return the original text.
TEXT:
{{ $json.title }}7. Fetch Full Issue Contents from Notion
Use the Get issue contents Notion node to fetch the full block contents of the TODO item, including nested blocks for detailed description.
Next, the Set page URL node saves the root Notion page URL, the root block content, and ID for reference.
8. Convert Notion Content to Markdown
The Convert contents to Markdown Code node converts Notion block content and nested items (bulleted list, checked boxes, images, videos) into Markdown format, preserving appropriate indentation and links.
This ensures that the Linear issue description is formatted and readable.
9. Aggregate Markdown Description
The Aggregate node combines all the Markdown lines into one single string for the Linear issue's description.
10. Prepare Issue Data for Creation
The Prepare issue data Set node builds the final data object with:
- Title (shortened if needed)
- Description, starting with a note that this issue was auto-created from the Notion block with a link back.
- Assignee ID from matching team member
11. Create the Linear Issue
The Create linear issue Linear node submits the issue creation request using the prepared data, including title, team ID, assignee ID, and description.
It then returns the newly created issue ID.
12. Fetch Linear Issue URL
The Get issue URL GraphQL node queries the created issue's URL for adding back to Notion.
13. Add Link to the Original Notion To-Do Block
The Add link to Notion block HTTP Request node patches the original Notion TODO block, replacing the content with a linked text pointing to the created Linear issue.
14. Loop Back for Next Item
The loop continues until all items are processed in batches, making this workflow ideal for multiple issues.
Customizations ✏️
- Add More Teams to the Dropdown: In the n8n Form Trigger node, add more Linear team names to the dropdown options to support more teams without code changes.
- Adjust Title Length Limits: In the Shorten title OpenAI node, modify the prompt or length thresholds to suit your preferred title limits.
- Modify Description Format: Customize the Prepare issue data node’s description template to include more project details or custom message formatting.
- Include Additional Notion Blocks: Extend the Notion content filter or converter code to include other block types or attachments.
- Change Assignee Matching Logic: Update the Set assignee and title code node to use exact matching instead of startsWith or add fallback logic.
Troubleshooting 🔧
Problem: "Couldn't fetch page content from Notion. Is it shared with your Notion integration?"
Cause: The Notion page you are trying to access is not shared with your API integration.
Solution: Go to Notion, share the page with the integration user or bot, and retry.
Problem: "Couldn't find the team called 'X'"
Cause: The Linear team name you entered does not exactly match any teams available via your API token.
Solution: Check your team name spelling in the form dropdown and verify team access rights.
Problem: Linear API request failures or issues not created.
Cause: Invalid or expired API credentials.
Solution: Verify your Linear API token is valid and correctly set in n8n credentials, then refresh.
Pre-Production Checklist ✅
- Verify the Notion page URL is correctly shared with your integration with read access.
- Ensure the Linear API credentials have permissions to create issues and read team data.
- Test the form trigger by submitting a sample Notion URL and team name.
- Check that TODO blocks in Notion follow the expected formatting, especially the assignee bracket notation.
- Run the workflow with test items and confirm Linear issues are created with correct assignees and descriptions including Notion links.
- Create backup of your Notion page content/structure before bulk imports to safeguard data.
Deployment Guide
To deploy this workflow, activate it in your n8n instance after completing setup of all credentials and environment variables.
Monitor workflow execution via n8n’s built-in execution logs for any errors or performance bottlenecks.
This workflow primarily operates on-demand via the form trigger webhook, so it will process issue imports each time the form is submitted.
FAQs
Q: Can I use other project management tools besides Linear with this workflow?
A: This workflow is tailored for Linear’s GraphQL API. To use another tool, you’d need to replace the Linear-specific nodes with appropriate API calls.
Q: Does the GPT-4 title shortening consume many API credits?
A: The node only triggers when titles are longer than 70 characters to minimize usage, keeping cost efficient.
Q: Is my data safe when using OpenAI API?
A: Your data is sent securely through OpenAI’s API. However, always review privacy policies before sharing sensitive information.
Q: How many issues can this workflow handle at once?
A: It uses batching and loops to process items efficiently, but heavy loads may need workflow performance tuning.
Conclusion
By following this guide, you’ve automated the tedious task of importing Notion TODO blocks as Linear issues, complete with assignee matching, title shortening, and linked references. You’ve saved hours of manual data entry and ensured consistent issue tracking for your team.
Next, you can enhance this workflow by integrating notifications via Slack when issues are created, adding comments on issue progress back to Notion, or syncing project statuses dynamically between APIs.
Keep experimenting with n8n and these APIs — automation like this unlocks time and precision in your project management routines. You’re well on your way to automating your entire product development lifecycle. Great work!