edgeLakeCodeQuery
Execute JavaScript programs server-side against Edge Lake event data for complex analysis that requires multiple queries, joins, aggregations, or funnel analysis.
Parameters
channelId
string (UUID)
Yes
The Edge Lake channel ID. Must be a channel with providerId: "edgeLake". Get this from the domains tool.
teamId
string (UUID)
Yes
The team ID the domain belongs to.
code
string
Yes
JavaScript code to execute server-side. Has access to codemode.query(sql) which returns { rows, meta }. Must return the final result.
Constraints
Maximum 20 queries per execution
80-second timeout
100KB maximum result size
Must return a final result (the last expression or explicit return)
API
Your code has access to:
codemode.query(sql)- Execute an SQL query againstlake.events. Returns{ rows, meta }.Promise.all()- Run multiple queries in parallel.Standard JavaScript (no external libraries).
Examples
Conversion funnel
Daily revenue trend
Last updated
Was this helpful?

