Guide to creating an autonomous AI that orchestrates actions across all workplace applications using Cortex’s function-calling capabilities.
Status: This guide is in progress.This guide walks you through designing an AI Chief of Staff—an AI version of n8n—powered by Cortex. Instead of only answering questions, this assistant can take actions across every app in your workspace by selecting and executing the correct function at the right time.
Note: All code examples in this guide are for demonstration purposes. They show the concepts and patterns you can use when building your own Glean-like application with Cortex APIs. Follow the actual API documentation to adapt these examples to your specific use case, technology stack, and requirements.
Goal: Let any agent ask Cortex “What should I do next?” and receive a structured function call (plus parameters) that your execution layer can run.
“The user wants to ‘prepare for tomorrow’s client meeting’—what should I do?”Cortex responds with context-aware suggestions:
send_slack_message
instead of send_email
for her urgent notifications.
/upload/upload_app_sources
endpoint you already know—set type: "function"
.
Tip: Keep function descriptions natural-language and goal-oriented—Cortex uses them during reasoning.
id: functionName_v2
. Mark old versions’ cortex_metadata.deprecated = true
so Cortex avoids suggesting them.
Notable Flags
auto_agent_routing
: Lets Cortex choose between answering vs acting.multi_step_reasoning
: Enables plans like “create Zoom, then email invite”.
check_customer_tier
→ Determines appropriate demo levelfind_available_demo_slots
→ Checks AE calendar availabilitycreate_demo_meeting
→ Books calendar event with zoom linkupdate_crm_opportunity
→ Logs demo request and scheduled datesend_confirmation_email
→ Notifies customer with detailscompile_kpi_dashboard
→ Gather latest metricsreview_action_items
→ Check previous meeting follow-upsbook_catering
→ Arrange refreshments based on attendee countsend_agenda_reminder
→ Notify board members 24 hours priorprepare_presentation_materials
→ Compile slide deck from templatescreate_incident_ticket
→ Log in tracking systemnotify_oncall_engineer
→ Alert via PagerDutyscale_database_resources
→ Auto-remediation attemptpost_status_update
→ Inform stakeholderslog_incident_details
→ Document for morning reviewmonitor_for_escalation
→ Set up enhanced alertingschedule_followup_review
→ Add to next team standupsend_slack_announcement
for immediate updatesupdate_project_timeline
for formal documentationschedule_team_meeting
for complex discussionssend_client_notification
if external communication is neededadmins
.task → function → result
for compliance.Metric | Why it matters |
---|---|
Suggested → Executed ratio | High ratio = Cortex understands tasks |
Average time-to-completion | Spot slow external APIs |
Rollback frequency | Detect unstable functions |
gather_data
→ generate_report
→ schedule_review_meeting
detect_anomaly
→ investigate_root_cause
→ implement_fix
→ verify_resolution
receive_lead
→ qualify_prospect
→ assign_sales_rep
→ schedule_discovery_call
billing
, hr
, sales
).