• PERSISTENCE
  • AUDIT
  • CLEANUP
  • HUMAN

How to track workflow state with your AI

Connect to Cosmos DB once. From then on, your agent can save its progress and pick up exactly where it left off.

Ask AI about this page

Short answer

How can I make my AI remember its progress?

Your agent writes status updates to Cosmos DB and reads them back to maintain context during long tasks. You'll see how it manages these records below.

Where state lands.

The outcomes of state management.

The AI uses NoSQL documents to keep track of everything it does.

PERSISTENCE

Saved progress

The AI writes a document to keep track of a task. This prevents the agent from losing its place if the session resets.

AUDIT

Step logs

The AI logs every intermediate action. You get a clear history of how the agent reached its conclusion.

CLEANUP

Old record removal

The AI deletes finished or expired status records. This keeps your container clean and organized.

HUMAN

Manual oversight

The AI leaves specific records for you to review. You decide when a workflow is officially complete.

The workflow

What your AI does when <the thing arrives>.

The AI treats your Cosmos DB container as a reliable scratchpad for complex operations.

  1. Initialize task

    The AI starts a new process by creating a fresh status document in your container.

    create_document
  2. Check status

    The AI looks up existing records to see if a specific job is already in progress.

    query_documents
  3. Update progress

    As the agent moves through steps, it updates the current document with new data.

    create_documentquery_documents
  4. Clear records

    The AI removes old or completed status documents to prevent clutter.

    delete_document

Try it

Copy these to start.

Use these prompts to begin managing state immediately.

Starting points

Replace the names in quotes with your actual container or document IDs.

Azure Cosmos DB Container Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_sR5SFdydHWMVwBi2kmwRkK1Y9eFVwnJ0PxFJe5pj/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Azure Cosmos DB Container capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "azure-cosmos-db-container-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_sR5SFdydHWMVwBi2kmwRkK1Y9eFVwnJ0PxFJe5pj/mcp"
    }
  }
}
Copy into chat04
  • Create a new status document in the 'active_jobs' container for the current migration task.

  • Check the 'workflow_state' container to see if the 'batch_process_01' is still running.

  • Log the results of this data validation into the 'audit_logs' container.

  • Delete all documents in the 'temp_cache' container that have a status of 'completed'.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Azure Cosmos DB Container once, then ask.

Connect your account once. Your credentials stay encrypted on our side, and you can start managing state immediately.

Connect Azure Cosmos DB Container to your AI

FAQ

How the state tracking behaves

  • 01

    Can the AI change my database settings?

    No. The AI can only interact with documents inside the containers you specify.

  • 02

    Will the AI delete my entire container?

    No. The AI only has the ability to delete specific documents, not entire containers.

  • 03

    How does the AI find the right document to update?

    The AI uses queries to locate the specific document ID before it performs any updates.

  • 04

    Can the AI create new containers for me?

    No. You must create the containers yourself; the AI only manages the documents within them.

  • 05

    Does the AI handle the connection logic?

    Yes. The MCP handles the connection so you can focus on the prompts.

  • More questions about Azure Cosmos DB Container? The Connector page answers them. See everything the Azure Cosmos DB Container Connector can do

Connect Azure Cosmos DB Container to Claude, Cursor, ChatGPT & more