Overview
This guide walks you through the complete process of integrating Snowflake Cortex Agents into your Elementum Apps. By connecting Cortex Agents, you enable AI-powered automation that runs directly on your Snowflake data warehouse, maintaining data security while leveraging advanced AI capabilities. Cortex Agents are configured at the App level through the Intelligence settings, allowing each App to discover and use external agents available through its CloudLink connection. What You’ll Accomplish:- Configure an App’s Intelligence settings to discover Cortex Agents
- Connect external Snowflake Cortex Agents to Elementum
- Integrate external agents into App automations
- Understand the technical architecture and APIs
Time Required: 10-20 minutes, depending on your existing Snowflake configuration
Prerequisites
Before beginning this setup, ensure you have the following in place:Elementum Requirements
App Access
Access to the App where you want to integrate Cortex Agents
Snowflake AI Provider
A configured Snowflake AI Provider with key-pair authentication CloudLink
Snowflake Requirements
Your Snowflake environment must have:- Snowflake Edition: Enterprise or higher
- Cortex AI Features: Enabled on your account
- Cortex Agents: At least one Cortex Agent configured in your Snowflake account
- Permissions: Service account with USAGE privileges on:
- Cortex functions
- Agent resources
- Target database and schema
Verify Your Snowflake AI Provider
Before proceeding, verify you have a Snowflake AI Provider configured:Check Snowflake Provider
Verify a Snowflake provider is configuredEnsure it uses a CloudLink with Key-Pair Authentication
Need Help with Providers? See the Snowflake Cortex Setup Guide for detailed instructions on configuring Snowflake AI Providers with key-pair authentication.
Step 1: Prepare Snowflake Cortex Agents
Before connecting to Elementum, ensure your Cortex Agents are properly configured in Snowflake.Verify Cortex Agents in Snowflake
- Using Snowflake UI
- Using SQL
- Log into your Snowflake account
- Navigate to AI & ML → Cortex Agents
- Verify your agents are listed and active
- Note the database and schema where agents are located
Required Permissions
Ensure your service account has the necessary permissions:Principle of Least Privilege: Grant only the minimum permissions necessary for the agents and data your Elementum automations will access.
Step 2: Configure Intelligence in Your App
Now you’re ready to discover and configure Snowflake Cortex Agents through your App’s Intelligence settings.Access Intelligence Settings
Add External Agent
Select External
In the agent type selection, choose “External”This indicates you’re connecting to an agent hosted outside Elementum
Select Snowflake AI Provider
Choose your configured Snowflake AI Provider from the dropdownProvider Selection:
- Only Snowflake providers with key-pair authentication appear
- The provider must have access to Cortex features
- Multiple providers can be available if you have different Snowflake environments
Discover Agents
The system uses the selected provider to discover available Cortex AgentsWhat happens:
- Elementum connects to Snowflake using the provider’s CloudLink credentials
- Queries the Snowflake Cortex REST API for available agents
- Lists all agents accessible through the provider’s service account
Select Cortex Agent
From the discovered agents list, select the Cortex Agent you want to useYou’ll see:
- Agent name
- Agent description
- Database and schema location
- Available capabilities
Configure Agent Settings
Agent Name: Optionally customize the display name in ElementumDescription: Add notes about how this agent will be used in your AppConfiguration: Review agent input/output schemas
What Happens During Discovery
When you add an external agent, Elementum:- Selects Provider: Uses the selected Snowflake AI Provider’s connection
- Authenticates: Authenticates with Snowflake using the provider’s CloudLink credentials
- Discovers Agents: Queries the Cortex REST API for available agents
- Retrieves Metadata: Gets agent capabilities, schemas, and configuration
- Registers Agent: Makes the agent available for use in App automations
- Monitors Status: Tracks agent availability through the provider connection
Step 3: Understanding Cortex REST APIs
Elementum leverages three primary Snowflake Cortex APIs for agent integration:Agent Discovery API
Discovers available agents accessible through your CloudLink. Snowflake Documentation: Cortex Agents REST API What Elementum Retrieves:- Agent names and identifiers
- Agent capabilities and descriptions
- Input/output schemas
- Required permissions
- Configuration metadata
Agent Run API
Executes agent tasks and retrieves results. Snowflake Documentation: Cortex Agents Run Used For:- Invoking agents from automations
- Passing input parameters
- Receiving agent responses
- Monitoring execution status
- Handling errors and timeouts
Threads API
Manages conversational threads for stateful agent interactions. Snowflake Documentation: Cortex Agents Threads REST API Capabilities:- Create conversation threads
- Maintain context across interactions
- Retrieve conversation history
- Resume interrupted conversations
- Manage thread lifecycle
API Authentication: All API calls use the credentials from the selected Snowflake AI Provider’s CloudLink connection, ensuring secure and auditable access to Cortex resources.
Step 4: Integrate Agents into Automations
With your Cortex Agent configured in Intelligence, you can now use it in App automations.Using External Agents in Automation Actions
Navigate to Automation Configuration
In your App, go to the automation where you want to use the external agent
Add Agent Action
Add a new automation action or edit an existing oneSelect “Agent Action” as the action type
Select Your External Agent
In the agent configuration:Agent: Choose the external Cortex Agent you configured in IntelligenceThe agent will be labeled as “External” or “Managed”
Configure Parameters
Input Mapping: Map automation data to agent input parameters
- Use field values from the current record
- Reference previous automation action outputs
- Include static values or formulas
- Map agent outputs to record fields
- Store results for later automation actions
- Set error handling behavior
Set Execution Options
Timeout: Set maximum execution time (default: 60 seconds)Retry Policy: Configure retry behavior for failuresError Handling: Define what happens if the agent fails
- Continue automation with default values
- Halt automation and alert user
- Escalate to human review
Example: Data Analysis Automation
Scenario: Automatically analyze sales data when a monthly report is requestedUsing Agents in Multiple Automations
External agents configured in Intelligence can be used across multiple automations within the same App:Automation Example: Anomaly Detection
Automation Example: Anomaly Detection
Trigger: New transaction record createdConditions: Transaction amount > $10,000Actions:
-
Call External Agent
- Agent: Fraud Detection Agent (Cortex)
- Input: Transaction details and customer history
- Output: Risk score and explanation
-
Conditional Logic
- If risk_score > 75: Flag for review and notify security team
- If risk_score 50-75: Request additional verification
- If risk_score < 50: Auto-approve transaction
-
Log Results
- Record analysis in audit log
- Update transaction status based on outcome
Step 5: Monitor and Maintain
Monitoring Agent Performance
Automation Logs
View agent execution logs in automation historyMonitor:
- Invocation frequency
- Response times
- Success/failure rates
- Error messages
Intelligence Dashboard
Track agent usage in Intelligence settingsView:
- Active agent connections
- Last successful execution
- Configuration changes
- CloudLink status
Provider Connection Health
Since external agents depend on the Snowflake AI Provider:- Monitor Provider Status: Ensure the provider and its CloudLink remain active
- Check Connectivity: Regularly test Snowflake connectivity through the provider
- Review Permissions: Verify service account permissions haven’t changed
- Update Credentials: Rotate provider CloudLink keys according to your security policy
Maintenance Tasks
- Regular Maintenance
- Updating Agents
- Scaling Considerations
Weekly:
- Review automation logs for agent errors
- Monitor agent performance metrics
- Check for timeout or failure patterns
- Review agent usage and optimization opportunities
- Audit permissions and access patterns
- Test agent functionality after Snowflake updates
- Rotate provider CloudLink credentials
- Review and optimize automation integrations
- Evaluate new Cortex Agent capabilities
Configuration Best Practices
Security Best Practices
Access Control
Minimal Permissions: Grant only necessary privilegesRole Separation: Use dedicated roles for agent accessAudit Logging: Enable comprehensive audit trailsRegular Reviews: Quarterly access audits
Credential Management
Rotation Schedule: Rotate keys every 90 daysSecure Storage: CloudLink manages credential encryptionNo Sharing: Unique credentials per environmentRevocation Process: Document emergency revocation steps
Performance Optimization
-
Warehouse Sizing
- Use appropriately sized warehouses for agent complexity
- Consider multi-cluster warehouses for concurrent agent calls
- Enable auto-suspend to minimize costs
-
Provider Management
- Provider connections are reused across multiple agent invocations
- Monitor provider connection performance metrics
- Configure appropriate timeout values
-
Timeout Configuration
- Set realistic timeouts based on agent complexity
- Implement progressive timeout strategies
- Consider async patterns for very long-running operations
-
Caching Strategies
- Cache agent responses for identical inputs
- Implement time-based cache invalidation
- Use Snowflake result caching when appropriate
Error Handling Patterns
Retry Logic
Retry Logic
Transient Failures: Implement exponential backoff for temporary issuesPermanent Failures: Don’t retry for authentication or permission errorsCircuit Breaker: Stop attempting after consecutive failures reach threshold
Fallback Strategies
Fallback Strategies
Default Values: Use sensible defaults when agent unavailableAlternative Agents: Configure backup agents for critical operationsHuman Escalation: Route to human review when automated analysis failsGraceful Degradation: Continue automation with reduced functionality
Troubleshooting
Discovery Issues
No Agents Discovered
No Agents Discovered
Error: “No agents found” when adding external agentPossible Causes:
- Snowflake AI Provider not configured or inactive
- Provider’s CloudLink has wrong permissions
- No Cortex Agents configured in Snowflake
- Service account lacks USAGE privileges
- Verify Snowflake AI Provider is configured in Organization Settings → Providers
- Check that provider uses a CloudLink with key-pair authentication
- Run
SHOW CORTEX AGENTSin Snowflake to verify agents exist - Verify service account has USAGE privileges on Cortex
- Check database and schema permissions
- Test provider connection in Provider settings
Provider Authentication Failed
Provider Authentication Failed
Error: “Unable to authenticate with Snowflake”Possible Causes:
- Provider CloudLink not configured with key-pair authentication
- Expired or invalid credentials
- Network connectivity issues
- Snowflake account unavailable
- Verify provider uses CloudLink with key-pair authentication (not password)
- Test provider connection in Organization Settings → Providers
- Check for expired credentials and refresh provider if needed
- Verify network connectivity to Snowflake
- Confirm Snowflake account is active and accessible
- Review provider configuration and CloudLink settings
Permission Denied Errors
Permission Denied Errors
Error: “Access denied to Cortex resources”Possible Causes:
- Missing USAGE grant on Cortex
- Insufficient privileges on agent
- Role not properly assigned
- Database or schema access missing
Runtime Issues
Agent Timeout
Agent Timeout
Error: “Agent execution exceeded timeout”Possible Causes:
- Agent task too complex for timeout setting
- Insufficient Snowflake warehouse resources
- Network latency issues
- Agent accessing large datasets
- Increase timeout value in automation configuration
- Scale up Snowflake warehouse for agent workload
- Optimize agent queries and data access
- Consider splitting complex tasks into multiple automation actions
- Use async invocation for long-running operations
Agent Returns Unexpected Results
Agent Returns Unexpected Results
Error: Agent output doesn’t match expected formatPossible Causes:
- Input parameters incorrect or malformed
- Agent configuration changed in Snowflake
- Schema version mismatch
- Data quality issues in source data
- Validate input parameters match agent expectations
- Test agent directly in Snowflake with same inputs
- Check for recent agent updates or schema changes
- Review agent logs in Snowflake for execution details
- Verify data quality and completeness
High Latency
High Latency
Error: Agent responses taking too longPossible Causes:
- Undersized Snowflake warehouse
- Network latency between Elementum and Snowflake
- Agent querying large datasets inefficiently
- Cold warehouse startup time
- Use larger warehouse for agent operations
- Keep warehouse running during peak usage (disable auto-suspend temporarily)
- Optimize agent queries and data access patterns
- Consider warehouse dedicated to agent workloads
- Implement result caching for repeated queries
Multi-App Configurations
Using Agents Across Multiple Apps
Each App configures its own external agents through Intelligence:Configure Per App
Each App that needs Cortex Agents must configure them individuallyEven if multiple Apps connect to the same Snowflake agents
Provider Selection
Apps can use:
- The same Snowflake AI Provider (shared access)
- Different providers (isolated access or different Snowflake environments)
Independent Configuration
Each App can:
- Select different providers pointing to different Snowflake accounts
- Use different agents from the same provider
- Configure the same agent differently
- Have unique timeout and error handling settings
Multi-Environment Setup
For organizations with multiple environments (dev, staging, production):Environment-Specific Providers
Configure separate Snowflake AI Providers for each environmentEach provider uses a CloudLink with environment-specific service accounts
Configure Agents Per Environment
In each environment’s App, configure external agents through IntelligenceSelect the appropriate provider (dev/staging/prod) to discover agents
Test Thoroughly
Test in dev environment before promoting to productionValidate in staging with production-like data
Example Use Cases
Use Case 1: Automated Data Quality Checks
Scenario: Automatically validate data quality when new datasets are loaded Implementation:- Create Cortex Agent in Snowflake for data profiling and quality analysis
- In your Data Management App, configure the agent through Intelligence
- Set up automation trigger on data load completion
- Agent analyzes dataset and returns quality metrics
- Automation creates alerts or blocks further processing based on results
- Immediate data quality feedback
- Prevents downstream issues from bad data
- Reduces manual validation effort
- Maintains audit trail of quality checks
Use Case 2: Intelligent Customer Support
Scenario: L1 support agent with direct access to customer data warehouse Implementation:- Create Cortex Agent trained on support knowledge base and customer data
- Configure agent in Support App through Intelligence
- Integrate agent into support automation
- Customer inquiry triggers agent to analyze history and suggest resolution
- Agent creates ticket with context and recommended actions
- Faster response times for customers
- Consistent support quality
- Reduces escalations to L2 support
- Data stays secure in Snowflake environment
Use Case 3: Financial Reporting Automation
Scenario: Generate executive reports with natural language insights Implementation:- Create Cortex Agent for financial analysis and narrative generation
- Configure agent in Finance App through Intelligence
- Schedule monthly report generation automation
- Agent analyzes trends, generates insights, and creates narrative
- Report distributed automatically with executive summary
- Consistent reporting schedule
- Natural language insights for non-technical stakeholders
- Reduces analyst workload
- Real-time access to latest data
Next Steps
Agent Orchestration Center
View and manage all agents across your organization
Agent Architecture
Understand the technical architecture and A2A protocol
Automation System
Learn how to build sophisticated automations with agents
Snowflake Cortex Docs
Reference Snowflake’s official Cortex Agents documentation
By integrating Snowflake Cortex Agents through your App’s Intelligence configuration, you create a powerful automation ecosystem that combines the flexibility of AI with the security of keeping your data in your own warehouse. This architecture ensures compliance, performance, and scalability for enterprise deployments.