@SuppressWarnings("unchecked")
    public static String jobName(RunContext runContext) {
        Map<String, String> flow = (Map<String, String>) runContext.getVariables().get("flow");
        Map<String, String> task = (Map<String, String>) runContext.getVariables().get("task");

        String name = Slugify.of(String.join(
            "-",
            flow.get("namespace"),
            flow.get("id"),
            task.get("id")
        ));
        String normalized = normalizeValue(name, true, true);
        if (normalized.length() > 58) {
            normalized = normalized.substring(0, 57);
        }

        // we add a suffix of 5 chars, this should be enough as it's the standard k8s way
        String suffix = RandomStringUtils.randomAlphanumeric(5).toLowerCase();
        return normalized + "-" + suffix;
    }
@Test
    void jobName() {
        var runContext = runContext(runContextFactory, "namespace");
        String jobName = ScriptService.jobName(runContext);
        assertThat(jobName, startsWith("namespace-flowid-task-"));
        assertThat(jobName.length(), is(27));

        runContext = runContext(runContextFactory, "very.very.very.very.very.very.very.very.very.very.very.very.long.namespace");
        jobName = ScriptService.jobName(runContext);
        assertThat(jobName, startsWith("veryveryveryveryveryveryveryveryveryveryveryverylongnames-"));
        assertThat(jobName.length(), is(63));
    }