Jae Wilson @DataCrew
Domo

Implement Sudo with Domo CodeEngine (automate actions across multiple instances using Python)

October 8, 2025

Managing one Domo instance via the API is straightforward. Managing a dozen — each with its own access token, host URL, and account object — is where most automation scripts fall apart.

Why It Matters

Without a consistent pattern, every function you write has to solve authentication from scratch for each instance. That means duplicated logic, brittle credential handling, and no clean way to fan out a single action across all your subscribers. A structured "sudo" pattern centralizes auth so your instance-specific logic stays focused on what it actually does — not on how to prove it's allowed to do it. For teams managing multi-tenant Domo deployments, this is the difference between a script that works once and a system that runs unattended.

What You'll Learn

  • Build a reusable Code Engine library that dispatches API calls across multiple Domo instances
  • Structure account objects so instance name maps directly to stored access token credentials
  • Centralize authentication in a single get_data function used by all action methods
  • Pass Domo instance context into each function to reconstruct the correct account name at runtime
  • Separate "what to do" logic from "how to authenticate" so new actions are easy to add