Extract File + SecondaryFiles by ExpressionTool

Hello I am new to CWL and puzzled by the following:

Rationale: I have a workflow with an input record containing a file field. The workflow uses an ExpressionTool to extract that file and pass it to CommandLineTool. The CommandLineTool expects an input file type with required secondaryFiles.

{
    "cwlVersion": "v1.2",
    "class": "Workflow",
    "inputs": [
        {
            "type": {
                "type": "record",
                "fields": [
                    {
                        "name": "somefile",
                        "type": "File",
                        "secondaryFiles": [
                            ".txt"
                        ]
                    }
                ]
            },
            "id": "somerecord"
        }
    ],
    "outputs": [],
    "steps": [
        {
            "in": [
                {
                    "id": "anyrecord",
                    "source": "somerecord"
                }
            ],
            "out": [
                {
                    "id": "extractedfile"
                }
            ],
            "run": {
                "class": "ExpressionTool",
                "inputs": [
                    {
                        "type": {
                            "type": "record",
                            "fields": [
                                {
                                    "name": "somefile",
                                    "type": "File",
                                    "secondaryFiles": [
                                        ".txt"
                                    ]
                                }
                            ]
                        },
                        "id": "anyrecord"
                    }
                ],
                "outputs": [
                    {
                        "type": "File",
                        "id": "extractedfile",
                        "secondaryFiles": [
                         ".txt"
                         ]
                    }
                ],
                "expression": "${\n  return {\"extractedfile\": inputs.anyrecord.somefile}\n }\n",
                "requirements": [
                    {
                        "class": "InlineJavascriptRequirement"
                    }
                ]
            },
            "id": "s0"
        },
        {
            "in": [
                {
                    "id": "myfile",
                    "source": "s0/extractedfile"
                }
            ],
            "out": [],
            "run": {
                "class": "CommandLineTool",
                "baseCommand": [
                    "cat"
                ],
                "inputs": [
                    {
                        "type": "File",
                        "secondaryFiles": [
                            ".txt"
                        ],
                        "inputBinding": {
                            "position": 1
                        },
                        "id": "myfile"
                    }
                ],
                "outputs": [],
                "arguments": [],
                "requirements": [
                    {
                        "class": "InlineJavascriptRequirement"
                    }
                ]
            },
            "id": "s1"
        }
    ],
    "requirements": [
        {
            "class": "SubworkflowFeatureRequirement"
        },
        {
            "class": "InlineJavascriptRequirement"
        }
    ]
}

Running this with cwltool 3 or toil is successful but issues the following Warning:
Workflow checker warning:
wf.cwl:22:9: Source ‘extractedfile’ of type “File” may be incompatible
wf.cwl:49:9: with sink ‘myfile’ of type "File"

However other platforms declare an invalid workflow stating that the secondaryFIles are missing for the input port of step 1.

I tried many things but nothing seemed to work, so I am likely missing something fundamental for the understanding. How can I pass the secondaryFiles through the expression?

Thanks a lot.

This is solved by adding the following to the output of the expressionTool:

                                    "secondaryFiles": [
                                        ".txt"
                                    ]

I somehow had the wrong assumption that the entire output would be overwritten by the expression’s output.