Domo's CodeEngine is a black box — unless you crack it open yourself. If you've ever needed to audit what API calls your CodeEngine functions actually make, or wanted to extract and version-control that logic in GitHub, regex is your crowbar.
Why It Matters
Without a systematic extraction process, understanding what a CodeEngine function does means manually opening each one. That doesn't scale when you have dozens of packages and hundreds of functions across versions. This approach lets you programmatically inspect every function's structure, determine whether it's making an outbound API request, and extract the actual URL pattern — turning an opaque runtime into something you can diff, document, and reason about.
What You'll Learn
- Understand the shape of a Domo version object: package ID, language, and embedded function definitions
- Use string matching and regex to detect whether a CodeEngine function issues an API request
- Extract URL patterns from JavaScript function bodies using regex (and when to lean on Copilot to write the hard parts)
- Distinguish between "interesting" functions (those hitting external APIs) and pure data transformation logic
- Structure your extraction pipeline to produce output worth committing to GitHub
Parsing CodeEngine Functions: Patterns and Decisions
The core data model here is the DomoVersion object, which wraps a package and its current state. Each version carries a list of functions — and each function includes its full source code. That's your raw material.
The first filter is blunt but effective: a simple string test checks whether URL (with a trailing space and hyphen) appears anywhere in the function body. If it doesn't, the function isn't touching an external API and gets skipped. No regex needed for that gate.
For functions that pass the first filter, a proper regex extracts the actual URL. The pattern targets the URL shape itself — including handling newline continuations that appear in multi-line JavaScript strings. This is where the video gets honest: regex for JavaScript parsing is painful, and the author used GitHub Copilot iteratively to get there. The workflow shown — paste a sample, describe the shape you want, iterate — is a practical pattern for anyone who doesn't write regex from memory.
One architectural note worth internalizing: the distinction between is_api_call (boolean) and extract_url (the actual value) keeps the logic composable. You can filter cheaply before you parse expensively, and you can extend either step independently as your extraction needs grow.
The end goal is a structured artifact per function — package, language, inputs, URL, HTTP method — that's meaningful enough to commit and diff in GitHub. That's what makes this more than a one-off script: it's the foundation for a living catalog of your CodeEngine surface area.



