This n8n workflow automatically fetches design assets (icons, buttons, etc.) from a Figma file, exports them into Android drawable folders for multiple screen densities (mdpi, hdpi, xhdpi, etc.), and commits them to a GitHub branch — creating a Pull Request with all updates.
It removes manual exporting, resizing, and uploading of assets, ensuring design and code stay perfectly in sync.
- Android and Flutter developers managing multi-density drawable assets
- Design and development teams automating asset delivery
- Mobile teams tired of manual export and upload workflows
- Projects where design assets change frequently and must stay in sync with code
- Trigger the workflow manually, on a schedule, or via webhook
- Fetch export URLs from a Figma file
- Filter components to include only relevant nodes (e.g.,
Icon,Button) - Prepare Android drawable folders (
drawable-mdpi,drawable-hdpi, etc.) - Map components to the correct density folders
- Call the Figma API to export images for all required densities
- Filter out invalid or empty export URLs
- Download images as binary files
- Normalize and rename files if required
- Check for existing open Pull Requests to avoid duplicates
- Commit files to a new GitHub branch and create a Pull Request
-
Create and connect a Figma API token in n8n (with access to the design file)
-
Copy the Figma File Key and, optionally, the parent Node ID containing assets
-
Connect your GitHub account in n8n using an OAuth token
-
Configure the target GitHub repository and base branch
-
Define:
- Drawable folder structure (
drawable-mdpi,drawable-hdpi, etc.) - File naming conventions
- Drawable folder structure (
-
Run the workflow to fetch and prepare assets
-
Verify the generated Pull Request contains all updated drawable assets
| Tool / Input | Purpose |
|---|---|
| Figma API Token | Fetch assets and export URLs from Figma |
| Figma File Key | Design file containing drawable assets |
| GitHub Token | Commit files and create Pull Requests |
| n8n | Workflow automation engine |
| Component Naming | Figma node names like Icon, Button for filtering |
- Add more component types (e.g.,
Avatar,Chip,Illustration) - Adjust folder structure for other platforms (iOS, Web, Flutter)
- Add image optimization (PNG compression) before committing
- Switch from PR creation to direct commits if required
- Trigger CI workflows after PR creation (GitHub Actions, Jenkins)
- Slack notifications when a Pull Request is created
- Changelog updates to append asset changes automatically
- Image format conversion (SVG → PNG, PNG → WebP)
- Auto-tagging releases based on asset updates
- Automatically export updated icons from Figma as Android assets
- Designers update assets → developers receive a ready-to-merge PR
- Maintain consistency across screen densities with zero manual work
- Run this workflow as part of weekly design–development syncs
| Issue | Possible Cause | Solution |
|---|---|---|
Export URL is null |
No export settings defined in Figma | Add export settings to each component in the Figma file |
| Images missing in PR | Incorrect merge or file naming logic | Verify merge logic and ensure correct file extensions |
| Duplicate PRs created | Existing PR check missing or incorrect | Add a check for open PRs on the same branch |
| Figma API errors (401/403) | Invalid or expired Figma token | Regenerate the token and update credentials in n8n |
| GitHub upload fails | Incorrect path or binary handling | Verify drawable folder paths and ensure valid binary data |
If you’d like help setting up, customizing, or extending this workflow, our WeblineIndia n8n automation experts can assist with:
- Fine-tuning Figma export filters
- Improving file naming and folder mapping
- Integrating Slack or CI pipelines
- Adding support for iOS, Web, or Flutter assets
Happy automating 🚀