danielgerlag / danielgerlag/workflow-core

YAML Deserializer Does Not Bind Inherited Property RunParallel for Custom Step Types for Foreach Step

Open
#1,375 2 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
Dominant language
C#
Stars
5.9k
Forks
1.3k
Avg merge
1d 1h
Merged PRs (30d)
5

Description

## **Description**

When using Workflow Core with YAML workflow definitions, if a custom step inherits from a built-in step (such as `Foreach`), the YAML deserializer fails to bind to public properties declared in the base class.

Example: `RunParallel` is a public property on `Foreach`, but if we create a custom step inheriting from `Foreach` and specify `RunParallel` in YAML, the engine throws:

```
System.ArgumentException: Unknown type for input RunParallel on IterateList
```

This happens even though:

* `RunParallel` is `public` in the base `Foreach` class.
* The YAML syntax works if the step type is `IterateListStep` without `RunParallel` argument.
* The property name `RunParallel` is correct and case matches exactly.

---

## **Steps to Reproduce**

**1. Create a custom step inheriting from `Foreach`:**

```csharp
public class IterateListStep : Foreach
{
// No additional properties for reproduction
}
```

**2. Define YAML workflow using the custom step:**

```yaml
- Id: IterateList
StepType: MyNamespace.IterateListStep, MyAssembly
Inputs:
Collection: "data.DataList"
RunParallel: false
```

**3. Load workflow using:**

```csharp
app.UseWorkflowConfiguration(DeserializerType.YAML);
```

**4. Run the workflow.**

---

## **Expected Behavior**

`RunParallel` should be recognized and correctly bound from YAML, even when the step is a subclass of `Foreach`.

---

## **Actual Behavior**

An exception is thrown:

```
System.ArgumentException: Unknown type for input RunParallel on IterateList
```

---

## **Environment**

Workflow Core version: 3.13.0

.NET version: 8

Deserializer: YAML

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.