Integration patterns

Pick the right building block for any external system, from a modern API to a website with no API.

Octocom connects to any system your business runs on, whether it offers a modern API, needs an app install or has only a website. This page shows which building block fits each kind of system, and why.

There is no fixed list of operations. An AI agent assembles the building blocks for your exact process. Where a platform grants API access only through an installed app or a sign-in, such as Shopify or Notion, its connector handles access. Your code then calls the platform's API, so it can do anything that API allows.

This is the technical companion to Connect any system.

Decision guide

Start from what the external system offers, or what needs to happen.

SituationUseWhy
The system has a REST or GraphQL API with an API keyAPI action or Python action with get_secretAny endpoint, any sequence of calls, with the key kept in the secret vault
The platform grants API access only through an app install or OAuthThe ready-made connector, then get_integration_credentials or shopify_graphqlThe connector handles access; your code calls the full platform API
The system only has a websiteBrowser automationGuarded, audited steps through the same pages a person uses
The system pushes events to you (callbacks, form posts)Custom HTTP endpointA URL backed by your Python, live without a deployment
The system needs to hear about Octocom eventsWebhooks (no code) or event handlers (Python)Signed, retried deliveries, or custom logic on every event
The system needs to call OctocomREST API with a scoped API keyA stable HTTP contract for your backend
You run a messaging channel Octocom has no connector forTwo-way messaging plus a webhookPush customer messages in over REST and receive every reply on your endpoint
Data must be synced or polled on a scheduleRecurring jobScheduled Python, no external cron server
The data is in a SQL Server databasesql_server_queryBounded, read-only queries with the credential kept in a secret
The data is in a Google SheetGoogle Sheets helpersRead, append and update rows and ranges in connected spreadsheets
A product catalog comes from a feed or APIProduct sync parserPython that turns any XML, CSV or JSON source into searchable catalog rows
The API only accepts allowlisted IP addressesproxy_request and proxy_session, or fetch_via_proxy in product sync parsersRequests leave from one stable Octocom IP address you can allowlist
You need to create or read PDFsrender_pdf and transcribe_pdfGenerate documents from HTML, or extract text with OCR
A person must make a decisionHuman-in-the-loop decisions or external decisionsThe AI agent keeps the conversation while a teammate or outside reviewer decides
Your agents should see the data while they workSidebar widgets and sidebar actionsLive data and buttons next to every conversation

Most real integrations combine several of these. A returns process might use a Python action to look up the order, a human decision for exceptions, an event handler to update the CRM when the conversation closes, and a recurring job to retry anything the CRM rejected.

APIs with a key

Use an API action for a single request with no logic: configure the URL, method, headers and body in the dashboard or with create_api_action, and mark inputs with $variableName. Use a Python action when you need several calls, validation, data shaping, or the key stored as a secret instead of in the action's configuration.

Store the key once with Settings -> Advanced -> Secrets or create_organization_secret, then read it by name:

def execute_action(context):
    key = get_secret("MONDAY_API_KEY")

    response = requests.post(
        "https://api.monday.com/v2",
        headers={"Authorization": key},
        json={"query": "{ boards(limit: 1) { id name } }"},
        timeout=30,
    )
    response.raise_for_status()
    return response.json()

API actions call public HTTP and HTTPS endpoints; private and internal network addresses are blocked. Share Python code between actions, condition providers, event handlers and jobs with Python modules.

Platforms that require an app install or OAuth

Some platforms only grant API access through an installed app or an OAuth sign-in. Install the ready-made connector by asking Copilot, or for most platforms under Settings -> Workspace -> Integrations. Then call the platform's API from Python:

  • get_integration_credentials(context) returns the stored credentials of every connected integration that exposes them, keyed by business slug. The helper page lists each integration and its fields.
  • shopify_graphql runs any Shopify Admin GraphQL query or mutation. Octocom attaches the store's token and sends the request from its fixed IP, so your code never holds the token.
  • Ready-made order and subscription helpers (Shopify, WooCommerce, Recharge and others) ship with their full source, as starting points you can adapt.

Agents can call list_integrations to see what each business has installed, and whether Python can read its credentials, before asking anyone for a key.

Systems without an API

Browser automation works with portals and back-office tools that only have a website. Explore the site with Copilot or the MCP browser tools, then save the verified steps as a Python action that uses open_browser. Every step checks the expected page state before and after it acts, and each run keeps audit evidence. In Copilot, clicks, edits and key presses during exploration ask for your approval first.

Events in both directions

  • The external system notifies Octocom. Create a custom HTTP endpoint: a URL that runs your Python handle(context) function. Endpoint URLs have no built-in authentication, so verify a shared token or the sender's signature at the start of handle, before any side effect.
  • Octocom notifies the external system. Use a webhook to POST signed JSON to your URL when a conversation is created, closed, handed off, tagged or rated, or when a message is sent. Use an event handler when the reaction needs logic, such as updating a CRM only for certain tags.
  • The external system calls Octocom. Use the REST API with an API key limited to the scopes it needs. For a messaging channel you run yourself, the two-way messaging API pushes customer messages in and delivers every reply on a webhook.

Schedules and polling

A recurring job runs Python on a cron schedule in the timezone you choose. Use it to sync records, poll a system that cannot push events, retry failed updates, or send a daily digest. Schedules run at most every 5 minutes, and each run has 5 minutes of elapsed time. For real-time reactions, use an event handler, a webhook or an HTTP endpoint instead.

To carry state between runs or between conversations, such as "orders to check again tomorrow", use the organization store.

Databases and spreadsheets

  • SQL Server. sql_server_query runs bounded SELECT queries. The connection details live in a JSON secret, Python never receives the stored password, and by default the login must be a dedicated read-only one.
  • Google Sheets. Connect the spreadsheet once, then use the Google Sheets helpers to list, append and conditionally update rows, or read and write ranges. Sheets work well as a shared log, a lookup table your team maintains, or a queue a person reviews.

Fixed IP addresses

Some APIs only accept requests from allowlisted IP addresses, or block cloud IP ranges. Route those calls through Octocom's stable outbound IP with proxy_request or proxy_session in actions, condition providers, event handlers, recurring jobs, HTTP endpoints and sidebar widgets, or with fetch_via_proxy in product sync parsers. The helper page lists the address to add to the provider's allowlist.

Files and PDFs

  • render_pdf(html, filename) turns a self-contained HTML document into a PDF and returns a shareable link, for invoices, quotes, certificates or reports.
  • transcribe_pdf(url) extracts text from a PDF at a public URL, including scanned pages.
  • Public files host images and documents at permanent public URLs for articles, workflows and actions.

People in the loop

Security practices

  • Least privilege. Give each integration its own key with only the permissions it needs, both in the external system and for Octocom API keys. For SQL Server, use a dedicated read-only login.
  • Keep credentials in secrets. Never hard-code a key, log it, return it from an action or store it in conversation metadata. Octocom removes stored secret values from output, but only in the exact form they were stored, so never print a secret even partially.
  • Return only what the customer may see. An action's result is visible to the AI agent and can reach the customer. Return the fields it needs, and abstract sensitive values (inStock: true rather than an exact stock count).
  • Verify the customer before acting. Require matching identifiers, such as email and order number, before returning protected data or changing anything. See Authentication and access control.
  • Confirm destructive actions. Ask the customer to confirm, or ask a teammate to decide, before refunds, cancellations and other irreversible changes.
  • Make retries safe. Use the idempotency features the building blocks provide: externalId when you push messages or import history through the REST API, the delivery ID on webhooks, the key of a human decision request, the idempotency_key of send_bot_message, and compare-and-set in the organization store. Never blindly resend a write after an ambiguous error.
  • Set timeouts. Python actions have a 120-second budget including HTTP calls, and API actions time out after 1 to 60 seconds. Give each outbound request a shorter timeout so the action can handle a slow system itself.
  • Authenticate inbound calls. Verify a token or signature at the start of every HTTP endpoint, and verify the signature of every webhook you receive.

Test before going live

  1. Test the code. Each code building block has a test tool that runs it with real inputs: test_api_action, test_python_action, test_condition_provider, test_event_handler, test_recurring_job, test_http_endpoint, test_sidebar_widget and test_webhook. run_python runs one-off code with the same helpers without saving anything. Tests execute real code and can make real changes in the external system, so test against safe records.
  2. Test the conversation. Enable the action in a workflow, then run test conversations that cover the normal path, missing data and failures. Agents can drive them with start_conversation and send_message.
  3. Watch the first runs. Check execution history (list_recurring_job_executions, list_http_endpoint_invocations, list_webhook_deliveries), and subscribe to the Automation Execution Failed event to hear about failing actions and condition providers.
  4. Keep a way back. Actions, condition providers, recurring jobs, HTTP endpoints and workflows keep every version. See Change history and restore.

For extra assurance on complex integrations, Octocom's solution engineers can review the design, test it with you and help plan the rollout.

On this page