Repository: kestra-io/kestra
Issue: The `disabled` flag is not respected on a WorkingDirectory task and leads to a never-ending Execution

```yaml 
      - id: wdir
        type: io.kestra.core.tasks.flows.WorkingDirectory
        tasks:
          - id: log 
            type: io.kestra.core.tasks.log.Log
            message: "{{ taskrun }}"
            disabled: true
```

the log task will start 

Issue comments:
I can reproduce this on the `develop` branch:

```yaml
id: hello-log
namespace: dev
tasks:
  - id: wdir
    type: io.kestra.core.tasks.flows.WorkingDirectory
    tasks:
      - id: log 
        type: io.kestra.core.tasks.log.Log
        message: "{{ taskrun }}"
        disabled: true
```

The log is printed, and the execution seems to be stuck in a running state due to `WorkingDirectory` never finishing 

![image](https://github.com/kestra-io/kestra/assets/86264395/121e67fd-3bbc-44b0-aa53-8f448a59bd5e)


Pull request review comments:

Patch that resolved the issue:
diff --git a/core/src/main/java/io/kestra/core/runners/FlowableUtils.java b/core/src/main/java/io/kestra/core/runners/FlowableUtils.java
index f93fe7b6d9..9f50132f3b 100644
--- a/core/src/main/java/io/kestra/core/runners/FlowableUtils.java
+++ b/core/src/main/java/io/kestra/core/runners/FlowableUtils.java
@@ -107,6 +107,9 @@ public static Optional<State.Type> resolveState(
             );
 
             return Optional.of(State.Type.FAILED);
+        } else if (currentTasks.stream().allMatch(t -> t.getTask().getDisabled()) && !currentTasks.isEmpty()) {
+            // if all child tasks are disabled, we end in SUCCESS
+            return Optional.of(State.Type.SUCCESS);
         } else if (!currentTasks.isEmpty()) {
             // handle nominal case, tasks or errors flow are ready to be analysed
             if (execution.isTerminated(currentTasks, parentTaskRun)) {
diff --git a/core/src/main/java/io/kestra/core/runners/Worker.java b/core/src/main/java/io/kestra/core/runners/Worker.java
index 36fc1549d4..62bafa15e8 100644
--- a/core/src/main/java/io/kestra/core/runners/Worker.java
+++ b/core/src/main/java/io/kestra/core/runners/Worker.java
@@ -154,6 +154,10 @@ private void handleTask(WorkerTask workerTask) {
                 workingDirectory.preExecuteTasks(runContext, workerTask.getTaskRun());
 
                 for (Task currentTask : workingDirectory.getTasks()) {
+                    if (Boolean.TRUE.equals(currentTask.getDisabled())) {
+                        continue;
+                    }
+
                     WorkerTask currentWorkerTask = workingDirectory.workerTask(
                         workerTask.getTaskRun(),
                         currentTask,


Test patch:
diff --git a/core/src/test/resources/flows/valids/working-directory.yaml b/core/src/test/resources/flows/valids/working-directory.yaml
index 5c309079bf..0bf3eda150 100644
--- a/core/src/test/resources/flows/valids/working-directory.yaml
+++ b/core/src/test/resources/flows/valids/working-directory.yaml
@@ -17,6 +17,9 @@ tasks:
         type: io.kestra.core.tasks.storages.LocalFiles
         outputs:
           - out/*
+      - id: disabled
+        type: io.kestra.core.tasks.debugs.Return
+        disabled: true
     errors:
       - id: error-t1
         type: io.kestra.core.tasks.debugs.Return