click-trigger.js 858 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @node click-trigger
  3. * @name Click Trigger
  4. * @category triggers
  5. * @version 1.0.0
  6. * @description Manual execution trigger - starts workflow when clicked
  7. * @trigger
  8. * @icon play
  9. */
  10. const configSchema = {
  11. type: 'object',
  12. properties: {
  13. label: {
  14. type: 'string',
  15. title: 'Button Label',
  16. default: 'Execute'
  17. }
  18. }
  19. };
  20. const inputSchema = {
  21. type: 'object',
  22. properties: {}
  23. };
  24. const outputSchema = {
  25. type: 'object',
  26. properties: {
  27. timestamp: { type: 'number' },
  28. triggeredBy: { type: 'string' }
  29. }
  30. };
  31. async function execute(config, input, context) {
  32. smartbotic.log.info('Click trigger activated');
  33. return {
  34. timestamp: Date.now(),
  35. triggeredBy: 'manual',
  36. executionId: context.executionId || smartbotic.utils.uuid()
  37. };
  38. }
  39. module.exports = { configSchema, inputSchema, outputSchema, execute };