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.,
[email protected]) - 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 in hook scripts using{{VARIABLE_NAME}} syntax:
Hook Script:
TEST_EMAIL=[email protected]TEST_PASSWORD=SecurePass123API_BASE_URL=https://api.staging.example.comEXPECTED_USERNAME=Alice Tester
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
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
{{VAR_NAME}}) - App not assigned to the environment
- Check variable name spelling and case
- Use
{{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