What are Project Variables?
Project Variables are project-specific values accessible across all components in your Project. They store:- API keys and secrets — Credentials for external services
- Configuration — Environment-specific settings
- Constants — Shared values used across Projects
- Feature flags — Toggle features on/off
Why use Project Variables?
Security — Keep secrets out of codeFlexibility — Change config without redeploying
Environments — Different values for dev/staging/prod
Reusability — One variable, many usages
Creating Variables
Via UI
- Go to Project → Variables
- Click Add Variable
- Configure:
- Name:
OPENAI_API_KEY
- Value:
sk-...
(hidden) - Type: Secret
- Description: API key for OpenAI
- Name:
- Click Save
Variable names
Conventions:UPPERCASE_WITH_UNDERSCORES
- Descriptive:
SENDGRID_API_KEY
notAPI_KEY_1
- Prefixed by service:
STRIPE_SECRET_KEY
,STRIPE_PUBLISHABLE_KEY
PATH
, HOME
, USER
Using Variables
In Actions
In Agent prompts
{{VAR_NAME}}
format are replaced before execution.
In Flow configurations
Conditional routing:In webhook payloads
Managing Variables
Viewing Variables
- Go to Organization → Project Variables
- See list of all variables
- Secrets show as
***
- Click to view metadata (not secret values)
Editing Variables
- Select variable
- Click Edit
- Modify value or description
- Click Save
Deleting Variables
- Select variable
- Click Delete
- Confirm
- Any components using this variable will fail
- Check usages before deleting
Finding usages
- Select variable
- Click Show Usages
- See list of Projects/components using it
Environment Variables
Triform provides built-in environment variables:Variable | Value | Description |
---|---|---|
TRIFORM_PROJECT_ID | proj_abc123 | Current Project ID |
TRIFORM_EXECUTION_ID | exec_xyz789 | Current execution ID |
TRIFORM_ORG_ID | org_abc123 | Organization ID |
TRIFORM_USER_ID | user_xyz789 | User who triggered execution |
TRIFORM_TIMESTAMP | ISO 8601 datetime | Execution start time |
Best practices
Never hardcode secrets — Always use Project Variables
Use descriptive names — Clear what each variable is for
Document variables — Add descriptions explaining usage
Rotate secrets regularly — Update API keys periodically
Test with dummy values — Use fake keys in dev/staging
Security considerations
Secret handling
Do:- ✅ Store all secrets in Project Variables
- ✅ Use
secret
type for sensitive data - ✅ Limit access to who can view secrets
- ✅ Rotate secrets regularly
- ✅ Audit secret access
- ❌ Hardcode secrets in code
- ❌ Log secret values
- ❌ Share secrets in chat/email
- ❌ Commit secrets to git
- ❌ Use production secrets in dev
Access control
Organization Admins: Can create, edit, delete all variablesOrganization Editors: Can view and use variables
Organization Viewers: Can see variable names but not values Project-specific permissions: Override Organization permissions
Audit logs
All variable operations are logged:- Created by whom, when
- Modified by whom, when, what changed
- Accessed by which execution
- Deleted by whom, when
- Go to Organization → Project Variables
- Select variable
- Click Audit Log
Migrating Variables
From hardcoded to variables
Before:- Create Project Variable
- Update code to use
os.environ.get()
- Test
- Remove hardcoded value
- Deploy
Troubleshooting
Problem: Variable not foundSolution: Check variable name and project Problem: Secret value showing as
***
Solution: Intentional for security. Re-enter to update. Problem: Variable changes not taking effect
Solution: Redeploy Project, or restart execution