What are Environments?
An Environment in Autosana serves two purposes:- App Organization: Group apps by deployment stage or purpose
- Configuration Management: Store environment-specific variables (API keys, URLs, credentials)
Creating an Environment
Step 1: Navigate to Settings
Click your profile icon or navigate to Settings from the sidebar.Step 2: Find the Environments Section
Scroll down to the Environments section.Step 3: Create Environment
- Click Create Environment
- Enter a name (e.g., “Development”, “Staging”, “Production”)
- Click Create
Managing Environment Variables
Environment variables are key-value pairs that you can reference in hooks and flow instructions. They make your flows and hooks reusable across different environments.Adding a Variable
- Find your environment in the Environments section
- Click Add Variable or the + icon
- Enter the Key (e.g.,
TEST_EMAIL) - Enter the Value (e.g.,
test@staging.com) - Click Save or press Enter
Editing a Variable
- Find the variable in the environment
- Click the pencil icon (✏️)
- Update the key or value
- Save changes
Deleting a Variable
- Find the variable in the environment
- Click the trash icon (🗑️)
- Confirm deletion
Using Environment Variables
In Hooks
Reference variables using${env:VARIABLE_NAME} syntax:
os.environ.get('TEST_EMAIL') in Python).
Learn more about using variables in hooks →
In Flow Instructions
You can also use variables directly in flow instructions:
Variable Scope
Variables are scoped to their environment:- Apps assigned to “Staging” environment use Staging variables
- Apps assigned to “Production” environment use Production variables
- Apps without an environment don’t have access to variables
The
${env:KEY} syntax also resolves runtime variables — suite variables, flow variables, hook exports, and values set by the agent — in addition to environment variables. Runtime variables take precedence over environment variables when they share the same key. See Variables for details on runtime variables, precedence, and dynamic agent variables.Assigning Apps to Environments
During App Creation
When creating a new app:- Select an environment from the Environment dropdown
- Complete the app creation process
For Existing Apps
- Navigate to the Apps page
- Find your app
- Click the Environment dropdown on the app card
- Select an environment
Use Cases
Development vs Production Credentials
Development Environment:Feature Flags
Staging Environment:Best Practices
Troubleshooting
Variable Not Replacing in Hook
Possible Causes:- Variable name doesn’t match exactly (case-sensitive)
- Typo in variable name
- Wrong syntax (must be
${env:VAR_NAME}) - App not assigned to the environment
- Check variable name spelling and case
- Use
${env:VARIABLE}— not{{VARIABLE}}or$VARIABLE - Verify app is assigned to the correct environment
Flow Works in One Environment but Not Another
Cause: Missing or different variables Solution:- Check that all required variables exist in both environments