title: CirclCI Pipeline Set a Variable within a Job and read it from Other with Condition evaluated with empty
body: <p>Please I'm trying to run some steps in the CircleCI Pipeline with conditions happened in the previous step. I tried a lot of tricks like exposing the value from Step 1 to global vars and pickup it in Step 2, I can see and print the variables in Step 2 but using WHEN BLOCK forever evaluated with Empty. I searched a lot and I knew that logical conditions already evaluated before running the jobs, Please I need alternative way to execute steps in second job in case a condition happened in Step 1?</p>
  <p>I pasted here the example that I'm trying to fix</p>
  <pre><code>version: 2.1
  
  orbs:
  
  workflows:
    test-and-deploy:
      jobs:
        - set-data:
            context: my-context
        - read-data:
            context: my-context
            requires:
              - set-data      
     
  definitions:
    node_image: &amp;node-image
      docker:
        - image: cimg/node:14.15.5
  
  executors:
    base-12-14-0:
      description: |
        Single Docker container with Node 12.14.0 and Cypress dependencies
        see https://github.com/cypress-io/cypress-docker-images/tree/master/base.
        Use example: `executor: cypress/base-12-14-0`.
      docker:
        - image: cypress/base:12.14.0
  
  jobs:
    set-data:
      &lt;&lt;: *node-image
      description: Sets the data
      steps:
        - run: echo &quot;VAR=app&quot; &gt; global-vars
        - persist_to_workspace: 
            root: .
            paths:
              - global-vars
    read-data: 
      &lt;&lt;: *node-image
      description: read the data
      steps:   
        - attach_workspace: 
            at: .
        - run: ls 
        - run: cat global-vars // I COULD HERE SEE THE CORRECT VAR inside global-vars
        - run: cat global-vars &gt;&gt; $BASH_ENV
        - run: echo &quot;Test $VAR&quot;  // Successfully Printed
        - when: 
            condition: 
              matches: {
                pattern: &quot;app&quot;,
                value: $VAR
              }
            steps:
              - run: echo &quot;Condition Executed&quot;
  </code></pre>