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(core): Workflow Execution Statistics #4200

Merged
merged 65 commits into from
Dec 6, 2022

Conversation

freyamade
Copy link
Contributor

No description provided.

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Sep 26, 2022
Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

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

image

Hey @freyamade I've left a couple comments with suggestions.

Also I had the above issue when starting n8n. I can help you debug if you need, LMK.

krynble
krynble previously approved these changes Dec 1, 2022
});

// Helper function that validates the ID, throws an error if not valud
async function checkWorkflowId(workflowId: string, user: User): Promise<WorkflowEntity> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check could be transformed to become a middleware since all endpoints in this controller follow the same logic. Also this can be simplified by running a single check to the SharedWorkflows table similar to what's done in the workflows.controller.ts as below:

		const shared = await Db.collections.SharedWorkflow.findOne({
			relations,
			where: whereClause({
				user: req.user,
				entityType: 'workflow',
				entityId: workflowId,
				roles: ['owner'],
			}),
		});

		if (!shared) {
			LoggerProxy.info('User attempted to access a workflow without permissions', {
				workflowId,
				userId: req.user.id,
			});
			throw new ResponseHelper.NotFoundError(
				'Could not load the workflow - you can only access workflows owned by you',
			);
		}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying that but for some reason I was running into a weird issue, something along the lines of column entityType does not exist if I remember right 🤔

packages/cli/src/api/workflowStats.api.ts Outdated Show resolved Hide resolved
krynble
krynble previously approved these changes Dec 6, 2022
@freyamade freyamade merged commit 1722c6b into master Dec 6, 2022
@freyamade freyamade deleted the feature/workflow-execution-statistics branch December 6, 2022 14:55
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Dec 6, 2022
MiloradFilipovic added a commit that referenced this pull request Dec 6, 2022
* master:
  refactor: Disable ESLint `indent` rule (no-changelog) (#4828)
  feat(core): Workflow Execution Statistics (#4200)
@janober
Copy link
Member

janober commented Dec 7, 2022

Got released with n8n@0.206.1

@janober janober removed the Upcoming Release Will be part of the upcoming release label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants