workflow-own-collection-granted.json 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. "name": "verify-workflow-own-collection-granted",
  3. "comment": "A workflow reaches its own private storage as \"@self\" without being granted anything, and the collection is created on first write rather than having to exist first. Reading it back matters as much as writing: a grant that only covers writes would store data the workflow could never use.",
  4. "nodes": [
  5. {
  6. "id": "n1",
  7. "name": "Trigger",
  8. "type": "click-trigger",
  9. "position": { "x": 0, "y": 0 },
  10. "config": {}
  11. },
  12. {
  13. "id": "write",
  14. "name": "Write to own storage",
  15. "type": "storage-insert",
  16. "position": { "x": 0, "y": 100 },
  17. "config": {
  18. "collectionSource": "manual",
  19. "collectionManual": "@self",
  20. "documentId": "probe",
  21. "documentData": "{\"probe\": \"own-collection\"}"
  22. }
  23. },
  24. {
  25. "id": "read",
  26. "name": "Read it back",
  27. "type": "storage-get",
  28. "position": { "x": 0, "y": 200 },
  29. "config": {
  30. "collectionSource": "manual",
  31. "collectionManual": "@self",
  32. "documentId": "probe"
  33. }
  34. }
  35. ],
  36. "connections": [
  37. {
  38. "sourceNodeId": "n1",
  39. "sourceOutput": "main",
  40. "targetNodeId": "write",
  41. "targetInput": "data"
  42. },
  43. {
  44. "sourceNodeId": "write",
  45. "sourceOutput": "main",
  46. "targetNodeId": "read",
  47. "targetInput": "data"
  48. }
  49. ],
  50. "expect": {
  51. "write": {
  52. "status": "completed",
  53. "output": { "success": true }
  54. },
  55. "read": {
  56. "status": "completed",
  57. "output": { "found": true, "document": { "probe": "own-collection" } }
  58. }
  59. }
  60. }