thankful-school-2023
10/11/2024, 12:18 AMhigh-park-82026
@dynamic
to run a fully dynamic workflow...
@dynamic
def my_dynamic_wf(inputs...):
... call this or that
The dynamic workflow won't immediately call this
or that
but instead figure out the workflow graph then execute it after the function returnsthankful-school-2023
10/11/2024, 12:33 AMdef user_defined_function():
# do something
@workflow
def subworkflow(custom_function: Any):
custom_function()
# do other things
@workflow
def workflow():
subworkflow(custom_function=user_defined_function)
# do more things
high-park-82026
def user_defined_function():
# do something
@workflow
def subworkflow(custom_function_name: Any):
conditional("func")._if(custom_function_name == "user_defined_function").then(custom_function())...
# do other things
@workflow
def workflow():
subworkflow(custom_function_name="user_defined_function")
# do more things
Are you trying to build a workflow that others can use and substitute their own implementation for a portion of it?high-park-82026
freezing-airport-6809
freezing-airport-6809
freezing-airport-6809
lively-whale-36781
10/11/2024, 5:09 PM@workflow
def workflow_with_udf_input(user_passed_in_func: Type):
// some logic
result=user_passed_in_func()
user's perspective
def user_defined_function():
@workflow
def user_invoke_our_workflow():
// some logic
workflow_with_udf_input(user_defined_function)
freezing-airport-6809
freezing-airport-6809
@eager