:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(cdp): add the replay vision step template and async function (#115251)
Tue Haulundf4acc48ea447
diff --git a/nodejs/src/cdp/async-functions/index.ts b/nodejs/src/cdp/async-functions/index.tsindex 9511a04143b5..cd6f911f0611 100644--- a/nodejs/src/cdp/async-functions/index.ts+++ b/nodejs/src/cdp/async-functions/index.ts@@ -4,6 +4,7 @@ import './create-customer-task'import './create-task'import './customer_analytics'import './fetch-handler'+import './replay-vision-scan'import './run-scout'import './send-email'import './send-push-notification'diff --git a/nodejs/src/cdp/async-functions/replay-vision-scan.ts b/nodejs/src/cdp/async-functions/replay-vision-scan.tsnew file mode 100644index 000000000000..de1cba9f9c21--- /dev/null+++ b/nodejs/src/cdp/async-functions/replay-vision-scan.ts@@ -0,0 +1,79 @@+import { DateTime } from 'luxon'++import { CyclotronInvocationQueueParametersFetchSchema } from '~/cdp/schema/cyclotron'+import { HogFlow } from '~/cdp/schema/hogflow'+import { defaultConfig } from '~/common/config/config'++import { registerAsyncFunction } from '../async-function-registry'+import { PosthogJwtAudience } from '../utils/jwt-utils'+import { ScopedServiceJwt } from '../utils/scoped-service-jwt'+import { workflowStepDispatchKeyFromInvocation } from '../utils/workflow-step-dispatch-key'++// The token rides the staged fetch verbatim through every engine retry, so it must outlive the whole+// backoff chain plus queue lag. The claims scope it to one team and workflow, which keeps the window cheap.+const TOKEN_TTL_SECONDS = 30 * 60++// Its own key, not postHogCreateTask's — see products/workflows/backend/service_jwt.py for why.+let visionRequestJwt: ScopedServiceJwt | undefined+const getVisionRequestJwt = (): ScopedServiceJwt =>+ (visionRequestJwt ??= new ScopedServiceJwt(+ PosthogJwtAudience.WORKFLOW_VISION_REQUEST,+ defaultConfig.WORKFLOW_VISION_REQUEST_JWT_SECRET+ ))++registerAsyncFunction('postHogReplayVisionScan', {+ execute: (args, context, result) => {+ const [payload] = args as [Record<string, any> | undefined]++ if (typeof payload?.session_id !== 'string' || !payload.session_id) {+ throw new Error("postHogReplayVisionScan call missing 'session_id' property")+ }++ // Both come from the flow-spawned invocation, never from step inputs: the hog_flow_id claim is what+ // the endpoint trusts, and the dispatch key is also the origin key that wakes this step when the scan ends.+ const hogFlow = (context.invocation as { hogFlow?: HogFlow }).hogFlow+ const idempotencyKey = workflowStepDispatchKeyFromInvocation(context.invocation)+ if (!hogFlow?.id || !idempotencyKey) {+ throw new Error('postHogReplayVisionScan only runs inside a workflow')+ }++ const jwt = getVisionRequestJwt()+ if (!jwt.enabled) {+ throw new Error(+ 'Replay Vision scans from a workflow are not configured in this environment (WORKFLOW_VISION_REQUEST_JWT_SECRET unset)'+ )+ }+ const token = jwt.mint({ team_id: context.invocation.teamId, hog_flow_id: hogFlow.id }, TOKEN_TTL_SECONDS)++ result.invocation.queueParameters = CyclotronInvocationQueueParametersFetchSchema.parse({+ type: 'fetch',+ url: `${context.siteUrl}/api/projects/${context.invocation.teamId}/workflow_vision_requests/`,+ method: 'POST',+ headers: {+ 'Content-Type': 'application/json',+ Authorization: `Bearer ${token}`,+ },+ body: JSON.stringify({+ session_id: payload.session_id,+ setup: payload.setup,+ wait_for_session_end: payload.wait_for_session_end !== false,+ idempotency_key: idempotencyKey,+ }),+ })+ },++ mock: (args, logs) => {+ logs.push({+ level: 'info',+ timestamp: DateTime.now(),+ message: `Async function 'postHogReplayVisionScan' was mocked with arguments:`,+ })+ logs.push({+ level: 'info',+ timestamp: DateTime.now(),+ message: `postHogReplayVisionScan(${JSON.stringify(args[0], null, 2)})`,+ })++ return { status: 202, body: { request_id: 'mock-request-id', status: 'running' } }+ },+})diff --git a/nodejs/src/cdp/config.ts b/nodejs/src/cdp/config.tsindex da93b3552029..46404d81caed 100644--- a/nodejs/src/cdp/config.ts+++ b/nodejs/src/cdp/config.ts@@ -229,6 +229,9 @@ export type CdpConfig = ClickhouseConfig & {WORKFLOW_SCOUT_RUN_JWT_SECRET: string// Scoped JWT keys signing the workflow engine's classify calls to Django. Its own key, for the same reason.WORKFLOW_CLASSIFY_JWT_SECRET: string+ // Scoped JWT keys signing the workflow engine's Replay Vision scan calls to Django. Its own key for the+ // same reason as the run-scout one, with the same rotation and fail-closed-when-empty semantics.+ WORKFLOW_VISION_REQUEST_JWT_SECRET: stringCYCLOTRON_NODE_RESCHEDULE_FLOOR_SECONDS: numberCYCLOTRON_NODE_RESCHEDULE_WAKE_RATE_PER_SECOND: numberCYCLOTRON_NODE_RESCHEDULE_MIN_WINDOW_SECONDS: number@@ -437,6 +440,7 @@ export function getDefaultCdpConfig(): CdpConfig {WORKFLOW_SCOUT_RUN_JWT_SECRET: isTestEnv() || isDevEnv() ? 'local-dev-workflow-scout-run-jwt' : '',// Dev/test default must match Django's (posthog/settings/data_stores.py).WORKFLOW_CLASSIFY_JWT_SECRET: isTestEnv() || isDevEnv() ? 'local-dev-workflow-classify-jwt' : '',+ WORKFLOW_VISION_REQUEST_JWT_SECRET: isTestEnv() || isDevEnv() ? 'local-dev-workflow-vision-request-jwt' : '',CYCLOTRON_NODE_RESCHEDULE_FLOOR_SECONDS: 600,CYCLOTRON_NODE_RESCHEDULE_WAKE_RATE_PER_SECOND: 200,CYCLOTRON_NODE_RESCHEDULE_MIN_WINDOW_SECONDS: 300,diff --git a/nodejs/src/cdp/schema/cyclotron.ts b/nodejs/src/cdp/schema/cyclotron.tsindex 9e02f6786226..560b39f4ba6e 100644--- a/nodejs/src/cdp/schema/cyclotron.ts+++ b/nodejs/src/cdp/schema/cyclotron.ts@@ -35,6 +35,7 @@ export const CyclotronJobInputSchemaTypeSchema = z.object({'task_repository','task_mcp_installations','signals_scout',+ 'replay_vision_scan','task_skills',]),key: z.string(),diff --git a/nodejs/src/cdp/services/hogflows/actions/hog_function.test.ts b/nodejs/src/cdp/services/hogflows/actions/hog_function.test.tsindex 4b6bf58dc81b..1241accd5a82 100644--- a/nodejs/src/cdp/services/hogflows/actions/hog_function.test.ts+++ b/nodejs/src/cdp/services/hogflows/actions/hog_function.test.ts@@ -951,6 +951,42 @@ describe('HogFunctionHandler', () => {expect(invocationResult.logs.map((l) => l.message)).toContainEqual(expect.stringContaining(expectedLog))})+ it('sizes an answer the template already has to the variables the run holds, without parking', async () => {+ action.output_variable = { key: 'answer' }+ invocation.state.variables = { ticket_body: 'y'.repeat(4700 - '{"ticket_body":""}'.length) }+ jest.spyOn(mockHogFlowFunctionsService, 'executeWithAsyncFunctions').mockResolvedValueOnce({+ finished: true,+ execResult: {+ request_id: 'r1',+ await: {+ max_wait: '8h',+ label: 'scan',+ result: { state: 'succeeded', output: 'x'.repeat(3000), warnings: ['The answer was cut.'] },+ },+ },+ invocation: invocation as any,+ logs: [],+ metrics: [],+ capturedPostHogEvents: [],+ warehouseWebhookPayloads: [],+ messageAssets: [],+ conversionWatchers: [],+ })++ const { handlerResult, invocationResult } = await execute()++ const stored = handlerResult.result as Record<string, unknown>+ expect(handlerResult.nextAction?.id).toBe('exit')+ expect(invocationResult.invocation.state.currentAction?.awaitingResume).toBeUndefined()+ expect(stored).toMatchObject({ request_id: 'r1', status: 'completed', state: 'succeeded' })+ expect(invocationResult.logs.map((l) => l.message)).toContainEqual(+ expect.stringContaining('The answer was cut.')+ )+ expect(+ Buffer.byteLength(JSON.stringify({ ...invocation.state.variables, answer: stored }))+ ).toBeLessThanOrEqual(5120)+ })+describe('on resume', () => {let executeSpy: jest.SpyInstanceconst deadlineAt = DateTime.now().plus({ hours: 1 }).toISO()!diff --git a/nodejs/src/cdp/services/hogflows/actions/hog_function.ts b/nodejs/src/cdp/services/hogflows/actions/hog_function.tsindex c48b7c897b47..1f9b42d9fcda 100644--- a/nodejs/src/cdp/services/hogflows/actions/hog_function.ts+++ b/nodejs/src/cdp/services/hogflows/actions/hog_function.ts@@ -40,8 +40,9 @@ type Action = Extract<HogFlowAction, { type: FunctionActionType }>type AwaitingResume = NonNullable<NonNullable<HogFlowInvocationContext['currentAction']>['awaitingResume']>-// A template parks the step by returning `{ ..., 'await': { 'max_wait': '190m', 'label': 'task' } }`.-type AwaitRequest = { maxWait: Duration; label: string }+// A template parks the step by returning `{ ..., 'await': { 'max_wait': '190m', 'label': 'task' } }`. When the+// job already finished, `'result': {...}` in the request hands over its answer as a wake would, without parking.+type AwaitRequest = { maxWait: Duration; label: string; settled: Record<string, unknown> | null }const AWAIT_DURATION_REGEX = /^(\d*\.?\d+)([dhms])$/const SECONDS_PER_UNIT: Record<string, number> = { d: 86400, h: 3600, m: 60, s: 1 }@@ -56,7 +57,11 @@ const parseAwaitRequest = (execResult: unknown): AwaitRequest | null => {if (typeof request !== 'object') {throw new Error(`await must be an object, got ${typeof request}`)}- const { max_wait: maxWait, label } = request as { max_wait?: unknown; label?: unknown }+ const {+ max_wait: maxWait,+ label,+ result: settled,+ } = request as { max_wait?: unknown; label?: unknown; result?: unknown }const match = typeof maxWait === 'string' ? AWAIT_DURATION_REGEX.exec(maxWait) : nullif (!match) {throw new Error(`await.max_wait must be a duration like '190m' or '2h', got ${JSON.stringify(maxWait)}`)@@ -65,6 +70,10 @@ const parseAwaitRequest = (execResult: unknown): AwaitRequest | null => {return {maxWait: requested > AWAIT_MAX_WAIT_CEILING ? AWAIT_MAX_WAIT_CEILING : requested,label: typeof label === 'string' && label ? label : 'run',+ settled:+ settled && typeof settled === 'object' && !Array.isArray(settled)+ ? (settled as Record<string, unknown>)+ : null,}}@@ -82,6 +91,26 @@ const counterAwaitedStepResumedWithWarnings = new Counter({help: 'A parked step resumed and continued, but the product that ran the job reported a warning.',})+// The product that ran the job reports what went wrong short of failing it, such as+// an agent whose output misses a field. The step continues; the author reads the log.+const logStepWarnings = (+ result: CyclotronJobInvocationResult<CyclotronJobInvocationHogFlow>,+ action: Action,+ stepResult: unknown+): void => {+ const warnings = readWarnings(stepResult)+ if (warnings.length > 0) {+ counterAwaitedStepResumedWithWarnings.inc()+ }+ for (const warning of warnings) {+ result.logs.push({+ level: 'warn',+ timestamp: DateTime.now(),+ message: `${actionIdForLogging(action)} ${warning}`,+ })+ }+}+const counterAwaitedStepStaleResume = new Counter({name: 'cdp_hogflow_awaited_step_stale_resume',help: 'A parked step received a wake keyed to an earlier visit of the same step and kept waiting.',@@ -226,6 +255,21 @@ export class HogFunctionHandler implements ActionHandler {})}}+ if (awaitRequest?.settled) {+ const { await: _await, ...dispatch } = functionResult.execResult as Record<string, unknown>+ // Read before sizing, which can drop the warnings themselves.+ logStepWarnings(result, action, awaitRequest.settled)+ // Sized like a woken step's answer, so it fits the variables the run already holds.+ return {+ nextAction: findContinueAction(invocation),+ result: capWorkflowStepResult(+ { ...dispatch, status: 'completed' },+ awaitRequest.settled,+ result.invocation.state.variables ?? {},+ action.output_variable+ ),+ }+ }if (awaitRequest) {return this.parkForAwaitedRun(invocation,@@ -308,19 +352,7 @@ export class HogFunctionHandler implements ActionHandler {timestamp: DateTime.now(),message: `${actionIdForLogging(action)} The ${label} finished`,})- // The product that ran the job reports what went wrong short of failing it, such as- // an agent whose output misses a field. The step continues; the author reads the log.- const warnings = readWarnings(resume.result)- if (warnings.length > 0) {- counterAwaitedStepResumedWithWarnings.inc()- }- for (const warning of warnings) {- result.logs.push({- level: 'warn',- timestamp: DateTime.now(),- message: `${actionIdForLogging(action)} ${warning}`,- })- }+ logStepWarnings(result, action, resume.result)return {nextAction: findContinueAction(invocation),result: payload,diff --git a/nodejs/src/cdp/templates/_destinations/posthog_replay_vision/posthog-replay-vision.template.test.ts b/nodejs/src/cdp/templates/_destinations/posthog_replay_vision/posthog-replay-vision.template.test.tsnew file mode 100644index 000000000000..f75bc1bbab74--- /dev/null+++ b/nodejs/src/cdp/templates/_destinations/posthog_replay_vision/posthog-replay-vision.template.test.ts@@ -0,0 +1,100 @@+import jwt from 'jsonwebtoken'++import { CyclotronInvocationQueueParametersFetchType } from '~/cdp/schema/cyclotron'+import { isNonFailureStatus } from '~/cdp/utils/non-failure-status-codes'+import { parseJSON } from '~/common/utils/json-parse'++import { TemplateTester } from '../../test/test-helpers'+import { template } from './posthog-replay-vision.template'++describe('posthog replay vision template', () => {+ const tester = new TemplateTester(template)++ const workflowOptions = { hogFlow: { id: '0198c9f1-0000-0000-0000-000000000001' }, actionId: 'action_1' }+ const analysis = { type: 'classifier', prompt: 'What did the user try to do?', tags: ['checkout', 'browse'] }+ const inputs = { session_id: 'session-1', analysis }++ beforeEach(async () => {+ await tester.beforeEach()+ })++ it('stages an authenticated scan request keyed to this step', async () => {+ const response = await tester.invoke(inputs, undefined, workflowOptions)+ expect(response.error).toBeUndefined()++ const params = response.invocation.queueParameters as CyclotronInvocationQueueParametersFetchType+ expect(params.url).toMatch(/\/api\/projects\/1\/workflow_vision_requests\/$/)+ expect(parseJSON(params.body!)).toEqual({+ session_id: 'session-1',+ setup: analysis,+ wait_for_session_end: true,+ idempotency_key: `${response.invocation.id}:action_1:0`,+ })++ const token = (params.headers?.['Authorization'] ?? '').replace('Bearer ', '')+ // The literal pins the cross-language contract: Django's dev default must match or local runs 401.+ // nosemgrep: javascript.jsonwebtoken.security.jwt-hardcode.hardcoded-jwt-secret+ const claims = jwt.verify(token, 'local-dev-workflow-vision-request-jwt', {+ audience: 'posthog:workflows:vision_request',+ algorithms: ['HS256'],+ }) as jwt.JwtPayload+ expect(claims.hog_flow_id).toBe(workflowOptions.hogFlow.id)+ })++ it.each([+ [+ 'parks while the scan runs',+ 202,+ { request_id: 'r1', status: 'running' },+ { request_id: 'r1', await: { max_wait: '8h', label: 'Replay Vision scan' } },+ ],+ [+ 'hands a settled answer to the engine to size, as a wake would',+ 202,+ { request_id: 'r1', status: 'completed', state: 'succeeded', output: { tag: 'checkout' }, warnings: [] },+ {+ request_id: 'r1',+ await: {+ max_wait: '8h',+ label: 'Replay Vision scan',+ result: { state: 'succeeded', output: { tag: 'checkout' }, warnings: [] },+ },+ },+ ],+ [+ 'skips the event at a daily limit',+ 409,+ { detail: 'This workflow reached the daily limit.' },+ { state: 'skipped', output: null, warnings: ['This workflow reached the daily limit.'] },+ ],+ ])('%s', async (_name, status, body, expected) => {+ let response = await tester.invoke(inputs, undefined, workflowOptions)+ response = await tester.invokeFetchResponse(response.invocation, { status, body })++ expect(response.error).toBeUndefined()+ expect(response.execResult).toEqual(expected)+ })++ it('lets the engine hand a daily-limit 409 to the code instead of failing the step', () => {+ const codes = template.inputs_schema.find((input) => input.type === 'non_failure_status_codes')+ expect(codes).toMatchObject({ required: true, hidden: true })+ expect(isNonFailureStatus(409, codes?.default)).toBe(true)+ expect(isNonFailureStatus(400, codes?.default)).toBe(false)+ })++ it('fails the step on a refused scan', async () => {+ let response = await tester.invoke(inputs, undefined, workflowOptions)+ response = await tester.invokeFetchResponse(response.invocation, {+ status: 400,+ body: { detail: 'Add at least one category.' },+ })++ expect(response.error).toMatch(/Add at least one category/)+ })++ it('fails without staging a request when the event has no session', async () => {+ const response = await tester.invoke({ ...inputs, session_id: '' }, undefined, workflowOptions)+ expect(response.error).toMatch(/no session recording/)+ expect(response.invocation.queueParameters).toBeUndefined()+ })+})diff --git a/nodejs/src/cdp/templates/_destinations/posthog_replay_vision/posthog-replay-vision.template.ts b/nodejs/src/cdp/templates/_destinations/posthog_replay_vision/posthog-replay-vision.template.tsnew file mode 100644index 000000000000..547aac35f445--- /dev/null+++ b/nodejs/src/cdp/templates/_destinations/posthog_replay_vision/posthog-replay-vision.template.ts@@ -0,0 +1,90 @@+import { HogFunctionTemplate } from '~/cdp/types'++import { hogApiErrorMessageFn } from '../../hog-helpers'++export const template: HogFunctionTemplate = {+ free: true,+ status: 'hidden',+ type: 'destination',+ id: 'template-posthog-replay-vision',+ name: 'Replay Vision',+ description:+ "Have Replay Vision watch the triggering event's session recording: answer a question, categorize, score or summarize it. The step waits for the answer, then passes it to the next step.",+ icon_url: '/static/posthog-icon.svg',+ category: ['Custom'],+ code_language: 'hog',+ code: `+${hogApiErrorMessageFn}++if (empty(inputs.session_id)) {+ throw Error('The triggering event has no session recording to analyze')+}++let response := postHogReplayVisionScan({+ 'session_id': inputs.session_id,+ 'setup': inputs.analysis,+ 'wait_for_session_end': inputs.wait_for_session_end != false+})++// A daily scan limit skips this event instead of failing the run.+if (response.status == 409) {+ print(apiErrorMessage(response))+ return { 'state': 'skipped', 'output': null, 'warnings': [apiErrorMessage(response)] }+}++if (response.status >= 400) {+ throw Error(f'Failed to start the Replay Vision scan ({response.status}): {apiErrorMessage(response)}')+}++let scan := response.body+// Park the step until the scan settles: up to 6 hours for the session to end, the scan itself, and slack for the wake.+let wait := { 'max_wait': '8h', 'label': 'Replay Vision scan' }+if (scan.status != 'running') {+ // An answer already settled goes through the same sizing a wake gets.+ wait.result := { 'state': scan.state, 'output': scan.output, 'warnings': scan.warnings }+}+return { 'request_id': scan.request_id, 'await': wait }+`,+ inputs_schema: [+ {+ key: 'analysis',+ type: 'replay_vision_scan',+ label: 'What should Replay Vision do?',+ secret: false,+ required: true,+ default: { type: 'monitor', prompt: '' },+ description: 'Ask a question, categorize, score or summarize the session, or use a saved scanner.',+ },+ {+ key: 'session_id',+ type: 'string',+ label: 'Session ID',+ secret: false,+ required: true,+ default: '{event.properties.$session_id}',+ description: 'The session recording to analyze. Defaults to the triggering event’s session.',+ },+ {+ key: 'wait_for_session_end',+ type: 'boolean',+ label: 'Wait for the session to end',+ secret: false,+ required: false,+ default: true,+ description:+ 'Scan the recording once the session has been quiet for 35 minutes, so the whole session is analyzed. Turn this off only when the triggering event comes after the session is over.',+ },+ {+ // The engine fails the step on a 4xx before the code above sees it, unless the status is listed here.+ // 409 is the daily scan limit, which the code turns into a skip. Required, though hidden, so a step+ // built through the API or MCP gets the default too (see the run-scout template).+ key: 'non_failure_status_codes',+ type: 'non_failure_status_codes',+ label: 'Non-failure status codes',+ secret: false,+ required: true,+ hidden: true,+ default: [409],+ },+ ],+}diff --git a/nodejs/src/cdp/templates/index.ts b/nodejs/src/cdp/templates/index.tsindex dad822a2bea1..e722d5bbd94d 100644--- a/nodejs/src/cdp/templates/index.ts+++ b/nodejs/src/cdp/templates/index.ts@@ -36,6 +36,7 @@ import { template as posthogTagAccountTemplate } from './_destinations/posthog_cimport { template as posthogUpdateAccountPropertyTemplate } from './_destinations/posthog_customer_analytics/posthog-update-account-property.template'import { template as posthogUpdateAccountRelationshipsTemplate } from './_destinations/posthog_customer_analytics/posthog-update-account-relationships.template'import { template as posthogUpdateAccountTemplate } from './_destinations/posthog_customer_analytics/posthog-update-account.template'+import { template as posthogReplayVisionTemplate } from './_destinations/posthog_replay_vision/posthog-replay-vision.template'import { template as posthogRunScoutTemplate } from './_destinations/posthog_signals/posthog-run-scout.template'import { template as posthogCreateTaskTemplate } from './_destinations/posthog_tasks/posthog-create-task.template'import { template as posthogClassifyTemplate } from './_destinations/posthog_workflows/posthog-classify.template'@@ -113,6 +114,7 @@ export const HOG_FUNCTION_TEMPLATES_DESTINATIONS: HogFunctionTemplate[] = [posthogCreateTaskTemplate,posthogRunScoutTemplate,posthogClassifyTemplate,+ posthogReplayVisionTemplate,posthogCreateAccountTemplate,posthogCreateCustomerTaskTemplate,posthogGetAccountTemplate,diff --git a/nodejs/src/cdp/types.ts b/nodejs/src/cdp/types.tsindex 2d6fc1f4254d..43619252bbfb 100644--- a/nodejs/src/cdp/types.ts+++ b/nodejs/src/cdp/types.ts@@ -575,6 +575,7 @@ export type HogFunctionInputSchemaType = {| 'task_repository'| 'task_mcp_installations'| 'signals_scout'+ | 'replay_vision_scan'| 'task_skills'key: stringlabel?: stringdiff --git a/nodejs/src/cdp/utils/jwt-utils.ts b/nodejs/src/cdp/utils/jwt-utils.tsindex b916d9acd5e4..c56ad4a2a557 100644--- a/nodejs/src/cdp/utils/jwt-utils.ts+++ b/nodejs/src/cdp/utils/jwt-utils.ts@@ -11,6 +11,8 @@ export enum PosthogJwtAudience {TASKS_CREATE = 'posthog:tasks:create',WORKFLOW_SCOUT_RUN = 'posthog:workflows:scout_run',WORKFLOW_CLASSIFY = 'posthog:workflows:classify',+ // Must match PosthogJwtAudience.WORKFLOW_VISION_REQUEST in posthog/jwt.py exactly.+ WORKFLOW_VISION_REQUEST = 'posthog:workflows:vision_request',// Must match PosthogJwtAudience.CONVERSATIONS_TICKETS in posthog/jwt.py exactly.CONVERSATIONS_TICKETS = 'posthog:conversations:tickets',// Must match PosthogJwtAudience.CUSTOMER_ANALYTICS_ACCOUNTS in posthog/jwt.py exactly.diff --git a/nodejs/tests/fixtures/hog-bytecode/4f496feabb1dcda6f8cc1f4c09a18f9ce44d66dd8014bd112d335e47f7b4c578.json b/nodejs/tests/fixtures/hog-bytecode/4f496feabb1dcda6f8cc1f4c09a18f9ce44d66dd8014bd112d335e47f7b4c578.jsonnew file mode 100644index 000000000000..0b4141db941f--- /dev/null+++ b/nodejs/tests/fixtures/hog-bytecode/4f496feabb1dcda6f8cc1f4c09a18f9ce44d66dd8014bd112d335e47f7b4c578.json@@ -0,0 +1 @@+["_H",1,32,"browse",38]diff --git a/nodejs/tests/fixtures/hog-bytecode/96cee3ceeb812f83686fa7d12809444f2568a24550e45c98aa5ad78f6ced0248.json b/nodejs/tests/fixtures/hog-bytecode/96cee3ceeb812f83686fa7d12809444f2568a24550e45c98aa5ad78f6ced0248.jsonnew file mode 100644index 000000000000..b8ab0ae95a65--- /dev/null+++ b/nodejs/tests/fixtures/hog-bytecode/96cee3ceeb812f83686fa7d12809444f2568a24550e45c98aa5ad78f6ced0248.json@@ -0,0 +1 @@+["_H",1,52,"apiErrorMessage",1,0,28,36,0,32,"body",45,32,"error",45,47,9,35,36,0,32,"body",45,32,"detail",45,47,6,35,36,0,32,"body",45,38,53,0,32,"session_id",32,"inputs",1,2,2,"empty",1,40,6,32,"The triggering event has no session recording to analyze",2,"Error",1,49,32,"session_id",32,"session_id",32,"inputs",1,2,32,"setup",32,"analysis",32,"inputs",1,2,32,"wait_for_session_end",30,32,"wait_for_session_end",32,"inputs",1,2,12,42,3,2,"postHogReplayVisionScan",1,33,409,36,1,32,"status",45,11,40,30,36,1,36,0,54,1,2,"print",1,35,32,"state",32,"skipped",32,"output",31,32,"warnings",36,1,36,0,54,1,43,1,42,3,38,33,400,36,1,32,"status",45,14,40,22,32,"Failed to start the Replay Vision scan (",36,1,32,"status",45,32,"): ",36,1,36,0,54,1,2,"concat",4,2,"Error",1,49,36,1,32,"body",45,32,"max_wait",32,"8h",32,"label",32,"Replay Vision scan",42,2,32,"running",36,2,32,"status",45,12,40,28,36,3,32,"result",32,"state",36,2,32,"state",45,32,"output",36,2,32,"output",45,32,"warnings",36,2,32,"warnings",45,42,3,46,32,"request_id",36,2,32,"request_id",45,32,"await",36,3,42,2,38,35,35,35,35]diff --git a/nodejs/tests/fixtures/hog-bytecode/9d22844c7911515c5918a635546baa868dde5e7359dd545053ebba9237058a30.json b/nodejs/tests/fixtures/hog-bytecode/9d22844c7911515c5918a635546baa868dde5e7359dd545053ebba9237058a30.jsonnew file mode 100644index 000000000000..a834fcf1e173--- /dev/null+++ b/nodejs/tests/fixtures/hog-bytecode/9d22844c7911515c5918a635546baa868dde5e7359dd545053ebba9237058a30.json@@ -0,0 +1 @@+["_H",1,32,"classifier",38]diff --git a/nodejs/tests/fixtures/hog-bytecode/c912f02c86b3e70588a63c3985f1c652bb7bbdf58d4316776ad45ef617da4642.json b/nodejs/tests/fixtures/hog-bytecode/c912f02c86b3e70588a63c3985f1c652bb7bbdf58d4316776ad45ef617da4642.jsonnew file mode 100644index 000000000000..2a1c7897b2cb--- /dev/null+++ b/nodejs/tests/fixtures/hog-bytecode/c912f02c86b3e70588a63c3985f1c652bb7bbdf58d4316776ad45ef617da4642.json@@ -0,0 +1 @@+["_H",1,32,"What did the user try to do?",38]diff --git a/nodejs/tests/fixtures/hog-bytecode/caf4b33eed007b02f649bc8794ab26dfe05aff4539f566d13bbc1e106ead64a2.json b/nodejs/tests/fixtures/hog-bytecode/caf4b33eed007b02f649bc8794ab26dfe05aff4539f566d13bbc1e106ead64a2.jsonnew file mode 100644index 000000000000..fa5eed72b26d--- /dev/null+++ b/nodejs/tests/fixtures/hog-bytecode/caf4b33eed007b02f649bc8794ab26dfe05aff4539f566d13bbc1e106ead64a2.json@@ -0,0 +1 @@+["_H",1,32,"session-1",38]