Figma Setup
Omni Architect generates design assets directly in Figma during Phase 4 of the pipeline. To enable this, you need to provide a Figma access token and file key. This guide walks you through the setup process.Prerequisites
Before starting, ensure you have:- A Figma account (free or paid)
- Edit access to the Figma file where assets will be generated
- For teams: Admin or Editor role in the Figma workspace
Step 1: Generate a Figma Access Token
Omni Architect uses a Personal Access Token to authenticate with the Figma API.Log in to Figma
Navigate to figma.com and log in to your account.
Generate New Token
Click Generate new token
- Token name:
Omni Architect(or any descriptive name) - Expiration: Choose based on your security policy
- For testing: 30 days
- For production: 90 days or Never (requires periodic renewal)
- Scopes: The default scope (full file access) is required
Step 2: Get Your Figma File Key
The file key identifies which Figma file will receive the generated assets.Finding the File Key
The file key is in your Figma fileβs URL:File Key in Figma URLs
Different Figma URLs contain the file key in the same position:| URL Type | Format | File Key Location |
|---|---|---|
| File view | figma.com/file/{KEY}/Name | Between /file/ and /Name |
| Design view | figma.com/design/{KEY}/Name | Between /design/ and /Name |
| Prototype | figma.com/proto/{KEY}/Name | Between /proto/ and /Name |
Step 3: Verify Permissions
Omni Architect requires specific permissions to create and modify Figma content.Required Permissions
| Permission | Reason | How to Check |
|---|---|---|
| File edit access | Create frames, pages, components | Open file β Can you edit objects? |
| API write access | Personal Access Token includes this by default | Token generated = write enabled |
| Workspace access | Read design system tokens (if using team library) | Workspace member with Editor role |
Testing Your Setup
Verify your token and file key work correctly:| Error | Cause | Solution |
|---|---|---|
403 Forbidden | Invalid token or expired | Regenerate token in Figma settings |
404 Not Found | Incorrect file key | Double-check file key from URL |
401 Unauthorized | Token not included | Ensure X-Figma-Token header is set |
Step 4: Configure Omni Architect
Now that you have your token and file key, configure Omni Architect:Option 1: Command-Line Arguments
Option 2: Environment Variables
Option 3: Configuration File
Create.omni-architect.yml in your project root:
Step 5: Understand What Gets Created
Omni Architect will create a structured hierarchy in your Figma file:Pages Created
- Index: Landing page with links to all generated frames
- User Flows: Flowchart diagrams as wireframed screens
- Interaction Specs: Sequence diagrams with interaction annotations
- Data Model: ER diagrams with entity documentation
- Architecture: C4 diagrams with system context
- Component Library: Reusable tokens and connectors
Frames Per Diagram Type
| Mermaid Diagram | Figma Asset |
|---|---|
flowchart | Wireframe user flow with screens connected by arrows |
sequenceDiagram | Interaction specification showing actor-system communication |
erDiagram | Visual data model with entities and relationships |
stateDiagram | State management component showing UI states |
C4Context | Architecture overview diagram |
journey | User journey map with touchpoints |
Advanced Configuration
Using Team Libraries
If your Figma workspace has a shared design system:Custom Design Systems
See the Custom Design Systems guide for detailed configuration of design tokens, colors, typography, and spacing.Troubleshooting
Error: 403 Forbidden
Error: 403 Forbidden
Cause: Your token doesnβt have access to the file, or the token is invalid.Solutions:
- Verify the token is correct and hasnβt expired
- Check you have edit access to the file (open it and try editing)
- Regenerate the token in Figma settings
- Ensure the file isnβt in a restricted workspace
Error: 404 Not Found
Error: 404 Not Found
Cause: The file key is incorrect or the file has been deleted.Solutions:
- Double-check the file key from the URL
- Ensure the file still exists (open it in Figma)
- Check for typos in the file key
Error: 429 Rate Limit Exceeded
Error: 429 Rate Limit Exceeded
Cause: Too many API requests in a short time.Solutions:
- Wait 60 seconds and retry
- Omni Architect has automatic exponential backoff, but very large PRDs may hit limits
- Consider using a Figma service account (higher rate limits) for production
Assets Not Appearing in Figma
Assets Not Appearing in Figma
Cause: API call succeeded but frames arenβt visible.Solutions:
- Refresh the Figma file (Cmd/Ctrl + R)
- Check the correct file is open (verify file key)
- Look for a new page group named β - Omni Architectβ
- Check the orchestration log for errors
Token Works Locally But Fails in CI/CD
Token Works Locally But Fails in CI/CD
Cause: Token not properly set in CI/CD secrets.Solutions:
- Add token to CI/CD secrets (GitHub Secrets, GitLab CI Variables, etc.)
- Verify the secret name matches your workflow:
- Ensure the token hasnβt expired
Security Checklist
Before deploying to production:- Token stored in secrets manager (not in code)
- Token expiration set to β€ 90 days
- Environment variable used for token (
$FIGMA_TOKEN) -
.envfile added to.gitignore - File key in config file (safe to commit)
- Team members know how to rotate tokens
- Monitoring set up for 401/403 errors (token expiration)
Next Steps
Custom Design Systems
Configure custom design tokens for brand consistency
Troubleshooting
Common Figma API issues and solutions