Skip to content

Commit

Permalink
feat(server): allow casting var assns
Browse files Browse the repository at this point in the history
  • Loading branch information
coltmcnealy-lh committed Dec 2, 2024
1 parent 956d78a commit ee3339c
Show file tree
Hide file tree
Showing 23 changed files with 1,166 additions and 406 deletions.
2 changes: 2 additions & 0 deletions docs/docs/08-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ have to worry about this in daily LittleHorse usage.
| `format_string` | oneof `source`| [VariableAssignment.FormatString](#variableassignmentformatstring) | Assign a format string |
| `node_output` | oneof `source`| [VariableAssignment.NodeOutputReference](#variableassignmentnodeoutputreference) | Assign the value of a NodeOutput. |
| `expression` | oneof `source`| [VariableAssignment.Expression](#variableassignmentexpression) | Assign the value of an Expression. |
| `type_to_cast_to` | optional| [VariableType](#variabletype) | Allows casting this Variable Assignment to a specific type |
<!-- end Fields -->
<!-- end HasFields -->

Expand All @@ -792,6 +793,7 @@ An Expression allows you to combine multiple values into one.
| `lhs` | | [VariableAssignment](#variableassignment) | The left-hand-side of the expression. |
| `operation` | | [VariableMutationType](#variablemutationtype) | The operator in the expression. |
| `rhs` | | [VariableAssignment](#variableassignment) | The right-hand-side of the expression. |
| `type_to_cast_to` | optional| [VariableType](#variabletype) | Allows casting this expression to a specific type |
<!-- end Fields -->
<!-- end HasFields -->

Expand Down
4 changes: 4 additions & 0 deletions schemas/littlehorse/common_wfspec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ message VariableAssignment {
VariableMutationType operation = 2;
// The right-hand-side of the expression.
VariableAssignment rhs = 3;
// Allows casting this expression to a specific type
optional VariableType type_to_cast_to = 4;
}

// If you provide a `variable_name` and the specified variable is JSON_OBJ or
Expand All @@ -67,6 +69,8 @@ message VariableAssignment {
// Assign the value of an Expression.
Expression expression = 6;
}
// Allows casting this Variable Assignment to a specific type
optional VariableType type_to_cast_to = 7;
}

// Enumerates the available operations to mutate a variable in a WfRun.
Expand Down
419 changes: 226 additions & 193 deletions sdk-go/lhproto/common_wfspec.pb.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ee3339c

Please sign in to comment.