- Introduced compileWorkflowScripts function to parse and validate workflow scripts, supporting both linear and DAG execution modes. - Added runLinearSteps and runDagSteps functions for executing compiled workflows based on their structure. - Updated createRegistry function to utilize the new workflow compilation and execution logic. - Enhanced script sandbox with meta extraction and instantiation capabilities for better script management. - Improved API endpoints to return script metadata and handle errors more effectively. - Removed deprecated scripts and updated workflows to reflect new structure and functionality.
27 lines
505 B
JavaScript
27 lines
505 B
JavaScript
// this script will get current time
|
|
|
|
function getCurrentTime() {
|
|
return {
|
|
data: {
|
|
datetime: new Date().toISOString(),
|
|
processId: "1234"
|
|
}
|
|
}
|
|
}
|
|
|
|
getCurrentTime.meta = {
|
|
description: "Return the current time as ctx.data.datetime",
|
|
config: {},
|
|
input: {},
|
|
output: {
|
|
datetime: { type: "string", description: "ISO timestamp" },
|
|
processId: { type: "string" },
|
|
},
|
|
example: {
|
|
data: {},
|
|
config: {},
|
|
},
|
|
};
|
|
|
|
export default getCurrentTime;
|