edgeLakeCodeQuery

Execute JavaScript programs server-side against Edge Lake event data for complex analysis that requires multiple queries, joins, aggregations, or funnel analysis.

circle-exclamation

Parameters

Parameter
Type
Required
Description

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 against lake.events. Returns { rows, meta }.

  • Promise.all() - Run multiple queries in parallel.

  • Standard JavaScript (no external libraries).

Examples

Conversion funnel

Daily revenue trend

circle-info

Edge Lake Querying must be enabled for your domain. Contact [email protected] if you get an "Action not permitted!" error.

Last updated

Was this helpful?