File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
metaflow/plugins/aws/step_functions Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -347,8 +347,13 @@ def resolve_token(name,
347
347
348
348
@parameters .add_custom_parameters (deploy_mode = False )
349
349
@step_functions .command (help = "Trigger the workflow on AWS Step Functions." )
350
+ @click .option ('--run-id-file' ,
351
+ default = None ,
352
+ show_default = True ,
353
+ type = str ,
354
+ help = "Write the ID of this run to the file specified." )
350
355
@click .pass_obj
351
- def trigger (obj , ** kwargs ):
356
+ def trigger (obj , run_id_file = None , ** kwargs ):
352
357
def _convert_value (param ):
353
358
# Swap `-` with `_` in parameter name to match click's behavior
354
359
val = kwargs .get (param .name .replace ('-' , '_' ).lower ())
@@ -362,9 +367,15 @@ def _convert_value(param):
362
367
response = StepFunctions .trigger (obj .state_machine_name , params )
363
368
364
369
id = response ['executionArn' ].split (':' )[- 1 ]
370
+ run_id = 'sfn-' + id
371
+
372
+ if run_id_file :
373
+ with open (run_id_file , 'w' ) as f :
374
+ f .write (str (run_id ))
375
+
365
376
obj .echo ("Workflow *{name}* triggered on AWS Step Functions "
366
- "(run-id *sfn-{id }*)."
367
- .format (name = obj .state_machine_name , id = id ), bold = True )
377
+ "(run-id *{run_id }*)."
378
+ .format (name = obj .state_machine_name , run_id = run_id ), bold = True )
368
379
369
380
370
381
@step_functions .command (
You can’t perform that action at this time.
0 commit comments