call-workflow-missing-input.json 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {
  2. "name": "verify-call-workflow-missing-input",
  3. "nodes": [
  4. {
  5. "id": "n1",
  6. "name": "Trigger",
  7. "type": "click-trigger",
  8. "position": {
  9. "x": 0,
  10. "y": 0
  11. },
  12. "config": {}
  13. },
  14. {
  15. "id": "call",
  16. "name": "Call",
  17. "type": "call-workflow",
  18. "position": {
  19. "x": 0,
  20. "y": 100
  21. },
  22. "config": {
  23. "workflowId": "{{helper:sub}}",
  24. "inputSource": "fields",
  25. "fields": [
  26. {
  27. "name": "label",
  28. "value": "no number given"
  29. }
  30. ]
  31. }
  32. }
  33. ],
  34. "connections": [
  35. {
  36. "sourceNodeId": "n1",
  37. "sourceOutput": "main",
  38. "targetNodeId": "call",
  39. "targetInput": "data"
  40. }
  41. ],
  42. "expect": {
  43. "call": {
  44. "status": "failed",
  45. "errorContains": "did not pass n"
  46. }
  47. },
  48. "helpers": [
  49. {
  50. "key": "sub",
  51. "name": "verify sub: double a number",
  52. "active": true,
  53. "nodes": [
  54. {
  55. "id": "in",
  56. "name": "Input",
  57. "type": "workflow-input",
  58. "position": {
  59. "x": 0,
  60. "y": 0
  61. },
  62. "config": {
  63. "fields": [
  64. {
  65. "name": "n",
  66. "type": "number",
  67. "required": true
  68. }
  69. ]
  70. }
  71. },
  72. {
  73. "id": "calc",
  74. "name": "Double",
  75. "type": "code",
  76. "position": {
  77. "x": 0,
  78. "y": 100
  79. },
  80. "config": {
  81. "code": "const d=input.data||input; return { doubled: Number(d.n)*2, label: d.label || \"none\" };"
  82. }
  83. },
  84. {
  85. "id": "out",
  86. "name": "Output",
  87. "type": "workflow-output",
  88. "position": {
  89. "x": 0,
  90. "y": 200
  91. },
  92. "config": {}
  93. }
  94. ],
  95. "connections": [
  96. {
  97. "sourceNodeId": "in",
  98. "sourceOutput": "main",
  99. "targetNodeId": "calc",
  100. "targetInput": "data"
  101. },
  102. {
  103. "sourceNodeId": "calc",
  104. "sourceOutput": "main",
  105. "targetNodeId": "out",
  106. "targetInput": "data"
  107. }
  108. ]
  109. }
  110. ]
  111. }