[meta]
    title = "Test for Github Issue 1543"
    description = """
        External trigger events should stimulate task processing even when
        nothing else is happening in the workflow. Here, long-running task bar
        ext-triggers foo when nothing else is happening. If task processing
        occurs foo will submit and kill bar, allowing the workflow to shutdown.
        Otherwise, foo won't submit, bar will keep running, and the workflow will
        time out.
    """

[scheduler]
    [[events]]
        abort on stall timeout = True
        stall timeout = PT30S
        abort on inactivity timeout = True
        inactivity timeout = PT30S

[scheduling]
    [[special tasks]]
        external-trigger = foo("drugs and money")
    [[graph]]
        # killed tasks are held to prevent retries; they have to be
        # released before they can be removed.
        R1 = """
            foo & bar?
            bar:fail? => handler
        """

[runtime]
    [[foo]]
        script = """
            cylc kill "$CYLC_WORKFLOW_ID//1/bar"
            cylc__job__poll_grep_workflow_log -E '1/bar.* \(internal\)failed'
            cylc release "$CYLC_WORKFLOW_ID//1/bar"
        """
    [[bar]]
        script = """
            sleep 5
            cylc ext-trigger $CYLC_WORKFLOW_ID "drugs and money" 12345
            sleep 60
        """
    [[handler]]
         script = true
