Skip to content

code_engine

code_engine

DomoWorkflow_Tile_CodeEngine dataclass

DomoWorkflow_Tile_CodeEngine(
    id: str,
    tile_type: str,
    index: int,
    x: float = 0.0,
    y: float = 0.0,
    title: str | None = None,
    dimensions: dict | None = None,
    data: dict = dict(),
    raw: dict = dict(),
    task_type: str | None = None,
    metadata: dict = dict(),
    inputs: list[DomoWorkflow_Parameter] = list(),
    outputs: list[DomoWorkflow_Parameter] = list(),
    uses_structured_outputs: bool = False,
    selected_task_title: str | None = None,
    selected_task_description: str | None = None,
    package_id: str | None = None,
    function_name: str | None = None,
    package_version: str | None = None,
    settings: dict = dict(),
)

Bases: DomoWorkflow_Tile_ServiceTask

serviceTaskNode with taskType='nebulaFunction' — a CodeEngine action tile.

This is the primary tile type for programmatic workflow construction. Use the create() classmethod for the cleanest ergonomics.

create classmethod

create(
    title: str,
    package_id: str,
    function_name: str,
    version: str,
    inputs: list[DomoWorkflow_Parameter] | None = None,
    outputs: list[DomoWorkflow_Parameter] | None = None,
    settings: dict | None = None,
    tile_id: str | None = None,
    x: float = 0.0,
    y: float = 0.0,
) -> DomoWorkflow_Tile_CodeEngine

Build a CodeEngine tile programmatically — no raw dict needed.

Parameters:

Name Type Description Default
title str

Display name shown on the tile in the Domo UI.

required
package_id str

CodeEngine package identifier.

required
function_name str

Name of the function to invoke.

required
version str

Package version string (e.g. "1.0.0").

required
inputs list[DomoWorkflow_Parameter] | None

Parameter list for the tile's inputs.

None
outputs list[DomoWorkflow_Parameter] | None

Parameter list for the tile's outputs.

None
settings dict | None

Extra metadata settings dict (optional).

None
tile_id str | None

Override the auto-generated UUID for the tile id.

None
x float

Canvas x position.

0.0
y float

Canvas y position.

0.0
Source code in src/crew_dcs/classes/DomoWorkflow/tile/code_engine.py
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
@classmethod
def create(
    cls,
    title: str,
    package_id: str,
    function_name: str,
    version: str,
    inputs: list[DomoWorkflow_Parameter] | None = None,
    outputs: list[DomoWorkflow_Parameter] | None = None,
    settings: dict | None = None,
    tile_id: str | None = None,
    x: float = 0.0,
    y: float = 0.0,
) -> DomoWorkflow_Tile_CodeEngine:
    """Build a CodeEngine tile programmatically — no raw dict needed.

    Args:
        title: Display name shown on the tile in the Domo UI.
        package_id: CodeEngine package identifier.
        function_name: Name of the function to invoke.
        version: Package version string (e.g. "1.0.0").
        inputs: Parameter list for the tile's inputs.
        outputs: Parameter list for the tile's outputs.
        settings: Extra metadata settings dict (optional).
        tile_id: Override the auto-generated UUID for the tile id.
        x: Canvas x position.
        y: Canvas y position.
    """
    metadata = {
        "packageId": package_id,
        "functionName": function_name,
        "version": version,
        "settings": settings or {},
    }
    data = {
        "title": title,
        "taskType": "nebulaFunction",
        "metadata": metadata,
        "input": [p.to_dict() for p in (inputs or [])],
        "output": [p.to_dict() for p in (outputs or [])],
        "usesStructuredOutputs": False,
        "position": {"x": x, "y": y},
    }
    return cls(
        id=tile_id or str(uuid.uuid4()),
        tile_type="serviceTaskNode",
        index=0,
        x=x,
        y=y,
        title=title,
        data=data,
        raw={},
        task_type="nebulaFunction",
        metadata=metadata,
        inputs=inputs or [],
        outputs=outputs or [],
        package_id=package_id,
        function_name=function_name,
        package_version=version,
        settings=settings or {},
    )