mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
- Moved n8n workflow schema to schemas/n8n-workflow.schema.json - Added `variables` property at workflow root level for type-safe, reusable workflow configuration - Implemented full variable system with: * Type system (string, number, boolean, array, object, date, any) * Validation rules (min, max, pattern, enum) * Scope control (workflow, execution, global) * Required/optional with default values - Created comprehensive N8N_VARIABLES_GUIDE.md (6,800+ words) with: * 5 real-world use case examples * Best practices and migration guide from meta to variables * Complete property reference and expression syntax - Created N8N_VARIABLES_EXAMPLE.json demonstrating e-commerce order processing - Documented schema gaps in N8N_SCHEMA_GAPS.md (10 missing enterprise features) - Created migration infrastructure: * scripts/migrate-workflows-to-n8n.ts for workflow format conversion * npm scripts for dry-run and full migration * N8N_COMPLIANCE_AUDIT.md tracking 72 workflows needing migration - Established packagerepo backend workflows with n8n schema format Impact: Variables now first-class citizens enabling DRY principle, type safety, and enterprise-grade configuration management across workflows. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
83 lines
1.9 KiB
JSON
83 lines
1.9 KiB
JSON
{
|
|
"name": "Authenticate User",
|
|
"description": "Login and generate JWT token",
|
|
"version": "1.0.0",
|
|
"nodes": [
|
|
{
|
|
"id": "parse_body",
|
|
"type": "packagerepo.parse_json",
|
|
"parameters": {
|
|
"input": "$request.body",
|
|
"out": "credentials"
|
|
}
|
|
},
|
|
{
|
|
"id": "validate_fields",
|
|
"type": "logic.if",
|
|
"parameters": {
|
|
"condition": "$credentials.username == null || $credentials.password == null",
|
|
"then": "error_invalid_request",
|
|
"else": "verify_password"
|
|
}
|
|
},
|
|
{
|
|
"id": "verify_password",
|
|
"type": "packagerepo.auth_verify_password",
|
|
"parameters": {
|
|
"username": "$credentials.username",
|
|
"password": "$credentials.password",
|
|
"out": "user"
|
|
}
|
|
},
|
|
{
|
|
"id": "check_verified",
|
|
"type": "logic.if",
|
|
"parameters": {
|
|
"condition": "$user == null",
|
|
"then": "error_unauthorized",
|
|
"else": "generate_token"
|
|
}
|
|
},
|
|
{
|
|
"id": "generate_token",
|
|
"type": "packagerepo.auth_generate_jwt",
|
|
"parameters": {
|
|
"subject": "$user.username",
|
|
"scopes": "$user.scopes",
|
|
"expires_in": 86400,
|
|
"out": "token"
|
|
}
|
|
},
|
|
{
|
|
"id": "respond_success",
|
|
"type": "packagerepo.respond_json",
|
|
"parameters": {
|
|
"body": {
|
|
"ok": true,
|
|
"token": "$token",
|
|
"username": "$user.username",
|
|
"scopes": "$user.scopes",
|
|
"expires_in": 86400
|
|
},
|
|
"status": 200
|
|
}
|
|
},
|
|
{
|
|
"id": "error_invalid_request",
|
|
"type": "packagerepo.respond_error",
|
|
"parameters": {
|
|
"message": "Missing username or password",
|
|
"status": 400
|
|
}
|
|
},
|
|
{
|
|
"id": "error_unauthorized",
|
|
"type": "packagerepo.respond_error",
|
|
"parameters": {
|
|
"message": "Invalid username or password",
|
|
"status": 401
|
|
}
|
|
}
|
|
]
|
|
}
|