Hello, I have a simple workflow with dataclass_jso...
# ask-the-community
a
Hello, I have a simple workflow with dataclass_json as the input:
Copy code
from flytekit import workflow, LaunchPlan, task
from dataclasses import dataclass
from dataclasses_json import dataclass_json

@dataclass_json
@dataclass
class MyDataClass(object):
    def __init__(self, a: int, b: str):
        self.a = a
        self.b = b

@task
def example_node(input: MyDataClass):
    print(f'{input.a}')
    

@workflow
def my_dataclass_workflow(input: MyDataClass):
    return example_node(input=input)
Should the UI be editable to provide input as json?
The input (struct*) is not editable:
n
hi @Ankit Goyal you’ll have to declare the dataclass like so:
Copy code
@dataclass_json
@dataclass
class MyDataClass(object):
    a: int
    b: str
once you do that the launch form UI should be more useful
a
ah, thank you! that was it.
122 Views