@@ -580,7 +580,7 @@ export class Message {
580580 break ;
581581 case "createworkflowinstance" :
582582 if ( ! this . EnsureJWT ( cli ) ) break ;
583- // await this.CreateWorkflowInstance(cli, span);
583+ await this . CreateWorkflowInstance ( cli , span ) ;
584584 break ;
585585 case "stripeaddplan" :
586586 if ( ! this . EnsureJWT ( cli ) ) {
@@ -2392,12 +2392,19 @@ export class Message {
23922392 msg . correlationId = NoderedUtil . GetUniqueIdentifier ( ) ;
23932393 }
23942394
2395+ ( msg as any ) . payload = msg . data ;
2396+ delete msg . data ;
2397+
23952398 const _data = Base . assign < Base > ( msg as any ) ;
23962399 Base . addRight ( _data , msg . targetid , "targetid" , [ - 1 ] ) ;
23972400 Base . addRight ( _data , cli . user . _id , cli . user . name , [ - 1 ] ) ;
23982401 Base . addRight ( _data , tuser . _id , tuser . name , [ - 1 ] ) ;
23992402 _data . _type = "instance" ;
24002403 _data . name = msg . name ;
2404+ ( _data as any ) . state = "new" ;
2405+ if ( ! msg . initialrun ) {
2406+ ( _data as any ) . form = "unknown" ;
2407+ }
24012408
24022409 const res2 = await Config . db . InsertOne ( _data , "workflow_instances" , 1 , true , msg . jwt , span ) ;
24032410 msg . newinstanceid = res2 . _id ;
@@ -4271,7 +4278,7 @@ export class Message {
42714278 const nextrun_seconds = Math . round ( ( end - wi . nextrun . getTime ( ) ) / 1000 ) ;
42724279 if ( seconds > 5 && nextrun_seconds >= 0 ) {
42734280 Config . db . queuemonitoringlastrun = new Date ( ) ;
4274- Config . db . queuemonitoring ( )
4281+ // Config.db.queuemonitoring()
42754282 }
42764283 } catch ( error ) {
42774284 await handleError ( null , error ) ;
@@ -4416,7 +4423,7 @@ export class Message {
44164423 const seconds = Math . round ( ( end - Config . db . queuemonitoringlastrun . getTime ( ) ) / 1000 ) ;
44174424 if ( seconds > 5 && isRelevant ) {
44184425 Config . db . queuemonitoringlastrun = new Date ( ) ;
4419- Config . db . queuemonitoring ( )
4426+ // Config.db.queuemonitoring()
44204427 }
44214428 } catch ( error ) {
44224429 await handleError ( null , error ) ;
@@ -4585,7 +4592,7 @@ export class Message {
45854592 const nextrun_seconds = Math . round ( ( end - wi . nextrun . getTime ( ) ) / 1000 ) ;
45864593 if ( seconds > 5 && nextrun_seconds >= 0 ) {
45874594 Config . db . queuemonitoringlastrun = new Date ( ) ;
4588- Config . db . queuemonitoring ( )
4595+ // Config.db.queuemonitoring()
45894596 }
45904597 }
45914598
0 commit comments