Browse Source

feat: return variables and table in execute workflow block

Ahmad Kholid 2 years ago
parent
commit
2eb03ea702
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/newtab/workflowEngine/blocksHandler/handlerExecuteWorkflow.js

+ 4 - 6
src/newtab/workflowEngine/blocksHandler/handlerExecuteWorkflow.js

@@ -19,6 +19,7 @@ function workflowListener(workflow, options) {
     const engine = new WorkflowEngine(workflow, options);
     engine.init();
     engine.on('destroyed', ({ id, status, message }) => {
+      console.log(engine.referenceData.table, engine.referenceData.variables);
       options.events.onDestroyed(engine);
 
       if (status === 'error') {
@@ -105,14 +106,11 @@ async function executeWorkflow({ id: blockId, data }) {
       },
       onDestroyed: (engine) => {
         if (data.executeId) {
-          const { dataColumns, globalData, googleSheets, table } =
-            engine.referenceData;
+          const { variables, table } = engine.referenceData;
 
           this.engine.referenceData.workflow[data.executeId] = {
-            globalData,
-            dataColumns,
-            googleSheets,
-            table: table || dataColumns,
+            table,
+            variables,
           };
         }
       },