Files
metabuilder/packagerepo/backend/workflows/resolve_latest.json
johndoe6345789 ce435a5e1b feat(schema): add n8n workflow schema with first-class variables support
- 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>
2026-01-22 18:38:37 +00:00

82 lines
1.9 KiB
JSON

{
"name": "Resolve Latest Version",
"description": "Get the latest version of a package",
"version": "1.0.0",
"nodes": [
{
"id": "parse_path",
"type": "packagerepo.parse_path",
"parameters": {
"path": "$request.path",
"pattern": "/v1/:namespace/:name/latest",
"out": "entity"
}
},
{
"id": "normalize",
"type": "packagerepo.normalize_entity",
"parameters": {
"entity": "$entity",
"out": "normalized"
}
},
{
"id": "query_index",
"type": "packagerepo.index_query",
"parameters": {
"key": "$entity.namespace/$entity.name",
"out": "versions"
}
},
{
"id": "check_exists",
"type": "logic.if",
"parameters": {
"condition": "$versions == null || $versions.length == 0",
"then": "error_not_found",
"else": "find_latest"
}
},
{
"id": "find_latest",
"type": "packagerepo.resolve_latest_version",
"parameters": {
"versions": "$versions",
"out": "latest"
}
},
{
"id": "get_meta",
"type": "packagerepo.kv_get",
"parameters": {
"key": "artifact/$entity.namespace/$entity.name/$latest.version/$latest.variant",
"out": "metadata"
}
},
{
"id": "respond_json",
"type": "packagerepo.respond_json",
"parameters": {
"body": {
"namespace": "$entity.namespace",
"name": "$entity.name",
"version": "$latest.version",
"variant": "$latest.variant",
"digest": "$latest.digest",
"size": "$metadata.size",
"uploaded_at": "$metadata.uploaded_at"
},
"status": 200
}
},
{
"id": "error_not_found",
"type": "packagerepo.respond_error",
"parameters": {
"message": "Package not found",
"status": 404
}
}
]
}