File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1172,7 +1172,7 @@ const config = {
11721172 rollback : {
11731173 type : "boolean" ,
11741174 description :
1175- "Run rollback before terminating. Only valid when action is terminate ." ,
1175+ "The option to trigger rollbacks when terminating the workflow instance ." ,
11761176 } ,
11771177 } ,
11781178 } ,
Original file line number Diff line number Diff line change @@ -1748,7 +1748,7 @@ export type WorkflowsChangeInstanceStatusData = {
17481748 type ?: "do" | "sleep" | "waitForEvent" ;
17491749 } ;
17501750 /**
1751- * Run rollback before terminating. Only valid when action is terminate .
1751+ * The option to trigger rollbacks when terminating the workflow instance .
17521752 */
17531753 rollback ?: boolean ;
17541754 } ;
Original file line number Diff line number Diff line change 18131813 },
18141814 "rollback" : {
18151815 "type" : " boolean" ,
1816- "description" : " Run rollback before terminating. Only valid when action is terminate ."
1816+ "description" : " The option to trigger rollbacks when terminating the workflow instance ."
18171817 }
18181818 }
18191819 }
Original file line number Diff line number Diff line change 11import type {
22 WorkflowBinding ,
3- WorkflowHandle ,
43 WorkflowInstanceRestartOptions ,
54 WorkflowInstanceTerminateOptions ,
65} from "@cloudflare/workflows-shared/src/binding" ;
@@ -73,8 +72,7 @@ class InstanceImpl implements WorkflowInstance {
7372 ) { }
7473
7574 private async getInstance ( ) : Promise < WorkflowInstance & Disposable > {
76- return ( await this . binding . get ( this . id ) ) as unknown as WorkflowInstance &
77- Disposable ;
75+ return ( await this . binding . get ( this . id ) ) as WorkflowInstance & Disposable ;
7876 }
7977
8078 public async pause ( ) : Promise < void > {
@@ -92,7 +90,11 @@ class InstanceImpl implements WorkflowInstance {
9290 ) : Promise < void > {
9391 using instance = await this . getInstance ( ) ;
9492 // TODO(vaish): remove cast once @cloudflare/workers-types ships terminate options
95- await ( instance as unknown as WorkflowHandle ) . terminate ( options ) ;
93+ await (
94+ instance . terminate as (
95+ options ?: WorkflowInstanceTerminateOptions
96+ ) => Promise < void >
97+ ) ( options ) ;
9698 }
9799
98100 public async restart (
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export class WorkflowBinding extends WorkerEntrypoint<Env> {
9999 } ;
100100 }
101101
102- public async get ( id : string ) : Promise < WorkflowHandle > {
102+ public async get ( id : string ) : Promise < WorkflowInstance > {
103103 const stubId = this . env . ENGINE . idFromName ( id ) ;
104104 const stub = this . env . ENGINE . get ( stubId ) ;
105105
You can’t perform that action at this time.
0 commit comments