windmill-labs/windmill · error
Could not find username for email '${email}' in workspace. M
Error message
Could not find username for email '${email}' in workspace. Make sure the user exists in the workspace. What it means
lookupUsernameByEmail built the workspace user cache via listUsers and found no user whose username or email matches the given email, so run-as identity resolution fails for settings like schedules/triggers that reference users by email.
Source
Thrown at cli/src/core/permissioned_as.ts:33
cache: Map<string, { username: string; email: string }>
): Promise<void> {
if (cache.size > 0) return;
const users = await wmill.listUsers({ workspace });
for (const user of users) {
cache.set(user.username, { username: user.username, email: user.email });
cache.set(user.email, { username: user.username, email: user.email });
}
}
export async function lookupUsernameByEmail(
workspace: string,
email: string,
cache: Map<string, { username: string; email: string }>
): Promise<string> {
await ensureUserCache(workspace, cache);
const entry = cache.get(email);
if (!entry) {
throw new Error(
`Could not find username for email '${email}' in workspace. ` +
`Make sure the user exists in the workspace.`
);
}
return entry.username;
}
export interface Change {
name: "edited" | "added" | "deleted";
path: string;
before?: string;
after?: string;
content?: string;
}
function contentHasOnBehalfOf(content: string, typeStr: string): boolean {
if (typeStr === "script") {
return (View on GitHub (pinned to e474e8803c)
Solutions
- Confirm the user exists in that workspace (Users page or `wmill user list`).
- Check the email spelling and casing.
- Invite the user to the workspace first, then retry.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at cli/src/core/permissioned_as.ts:33 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/681b9cee84d5d927.
Report an issue: GitHub.