def METHOD_NAME(tmpdir, flow):
    with flow:
        ret = flow.post(
            on='index',
            inputs=DocumentArray(
                [
                    Document(text='type1', tags={'type': 1}),
                    Document(text='type2', tags={'type': 2}),
                ]
            ),
        )
        assert len(ret) == 2
        types_set = set()
        for doc in ret:
            if doc.tags['type'] == 1:
                assert doc.text == 'type1 processed by exec1'
            else:
                assert doc.tags['type'] == 2
                assert doc.text == 'type2 processed by exec2'
            types_set.add(doc.tags['type'])
        assert types_set == {1, 2}
    with open(os.path.join(str(tmpdir), 'exec1', '0', f'exec1.txt'), 'r', encoding='utf-8') as fp:
        assert fp.read() == 'type1'
    with open(os.path.join(str(tmpdir), 'exec2', '0', f'exec2.txt'), 'r', encoding='utf-8') as fp:
        assert fp.read() == 'type2'