Files
Shaurya Srivastava 50c3223ce3 Feat: add configurable HTTP timeout to request, webhook, and notification steps (#7243)
* Feat: expose HTTP timeout on built-in workflow steps

Allow request, webhook, and notification steps to set an optional
timeout (Go duration string) that is forwarded to http.#HTTPDo as
request.timeout, so slow HTTP calls are no longer stuck at the 3s default.

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>

* Feat: Made requested changes

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>

* Fix: align timeout duration regex with Go ParseDuration

Accept "0" and leading-dot fractions like ".5s", matching
time.ParseDuration more closely while still rejecting unit-less
values such as "30".

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>

---------

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
2026-07-22 16:32:18 -07:00

927 B

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: request-http
  namespace: default
spec:
  components: []
  workflow:
    steps:
    - name: request
      type: request
      properties:
        url: https://api.github.com/repos/kubevela/workflow
        timeout: 30s
      outputs:
        - name: stars
          valueFrom: |
            import "strconv"
            "Current star count: " + strconv.FormatInt(response["stargazers_count"], 10)
    - name: notification
      type: notification
      inputs:
        - from: stars
          parameterKey: slack.message.text
      properties:
        slack:
          url:
            value: <your slack url>
    - name: failed-notification
      type: notification
      if: status.request.failed
      properties:
        slack:
          url:
            value: <your slack url>
          message:
            text: "Failed to request github"