Hello, My workflow reads from a file parameters.js...
# ask-the-community
f
Hello, My workflow reads from a file parameters.json and pass the dict content of it to the tasks.
Copy code
def get_config():
    current_directory = os.getcwd()
    print("Current directory:", current_directory) # .../dai-mle-paid-renewal
    # Open the JSON file
    with open('parameters.json') as f:
        # Load the contents of the file into a dictionary
        # params = f.read()
        params = json.load(f)
        print(type(params))
        print(params)
        return params
@task
def test(config: Dict[str, Any]) -> None:
    print(config)

@workflow
def wf(config: Dict[str, Any] = get_config()) -> None:
   test(config=config)
167 Views