millions-night-34157
03/07/2024, 10:45 AMconditional@task
def file_exists_on_s3(bucket:str, path: str) -> Optional[str]:
    # this is not actual code
    full_path = bucket + path
    if S3.exists(full_path):
        return full_path
    else:
        return None
@task
def process_file(file_path:str) -> str:
    # process given file
    # write new file on s3
    return new_file_path
@task
def noop_task() -> str:
    return "noop"
@workflow
def my_awesome_workflow() -> str:
    file_path = file_exists_on_s3(bucket="my_bucket", path: "path/inside/bucket/file.txt")
    return conditional("file_exists_condition")
    .if_(file_path.is_none())
    .then(process_file(file_path=file_path))
    .else_()
    .then(noop_task())noop_task().then()Promisenoop_task().then()tall-lock-23197
