Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Telemetry include basic llm optional promps, trigger on save workflow event #8981

Merged
merged 4 commits into from
Mar 27, 2024

Conversation

michael-radency
Copy link
Contributor

Summary

Telemetry prompts missing in some events

Related tickets and issues

https://linear.app/n8n/issue/AI-161/telemetry-prompts-missing-in-some-events

@michael-radency michael-radency added the n8n team Authored by the n8n team label Mar 27, 2024
Comment on lines +205 to +209
const isCloudDeployment = config.getEnv('deployment.type') === 'cloud';

const { nodeGraph } = TelemetryHelpers.generateNodesGraph(workflow, this.nodeTypes, {
isCloudDeployment,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we filtering for cloud? The story doesn't mention this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is followup to this issue, should be enabled on cloud only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, let's use config inside the function itself.

Comment on lines 281 to 283
nodeItem.prompts =
(((node.parameters?.messages as IDataObject) || {}).messageValues as IDataObject[]) || [];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please find a way to avoid so many assertions? And use nullish coalescing instead of ||? Also is there really a case where prompts will be an empty array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we had to use those assertions as parameter would not be included if value is default, yes by default in basic llm it is an empty array

@@ -488,7 +492,7 @@ export class InternalHooks {
? this.eventBus.sendWorkflowEvent({
eventName: 'n8n.workflow.success',
payload: sharedEventPayload,
})
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some formatting issues to autofix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier got got confused here, I did refactor code slightly

Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock the release, we discuss minor details later.

Copy link

cypress bot commented Mar 27, 2024

2 flaky tests on run #4481 ↗︎

0 343 12 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 michael-radency 🗃️ e2e/*
Project: n8n Commit: 966dc2905a
Status: Passed Duration: 03:58 💡
Started: Mar 27, 2024 3:11 PM Ended: Mar 27, 2024 3:15 PM
Flakiness  17-sharing.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Sharing > should work for admin role on credentials created by others (also can share it with themselves) Test Replay Screenshots Video
Flakiness  5-ndv.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Test Replay Screenshots Video

Review all test suite changes for PR #8981 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov merged commit 335f363 into master Mar 27, 2024
32 checks passed
@ivov ivov deleted the ai-161-telemetry-prompts-missing-in-some-events branch March 27, 2024 15:16
This was referenced Mar 27, 2024
@janober
Copy link
Member

janober commented Mar 27, 2024

Got released with n8n@1.35.0

@github-actions github-actions bot mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants