Ramp · Arazzo Workflow

Ramp Flag Large Transaction

Version 1.0.0

List transactions in a window and branch on whether the first one exceeds a threshold.

1 workflow 1 source API 1 provider
View Spec View on GitHub FinanceSpend ManagementCorporate CardsExpense ManagementAccounts PayableBill PayAccountingReimbursementsArazzoWorkflows

Provider

ramp

Workflows

flag-large-transaction
Branch into a transaction detail lookup only when the first transaction exceeds a threshold.
Lists transactions in a date window and conditionally retrieves the full record of the first transaction when its amount is above the threshold.
2 steps inputs: accessToken, fromDate, threshold, toDate outputs: flaggedAmount, flaggedMerchant, flaggedTransactionId
1
listTransactions
listTransactions
List transactions for the date window and capture the first transaction's id and amount for the threshold comparison.
2
getLargeTransaction
getTransaction
Retrieve the full record of the first transaction because its amount exceeded the supplied threshold.

Source API Descriptions

Arazzo Workflow Specification

ramp-flag-large-transaction-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Ramp Flag Large Transaction
  summary: List transactions in a window and branch on whether the first one exceeds a threshold.
  description: >-
    A lightweight spend-control read flow. The workflow lists transactions in a
    date window, then branches: when the first transaction's amount exceeds a
    supplied threshold it retrieves the full transaction record for review, and
    when it does not it ends without a detail lookup. This adapts a spend-limit
    enforcement theme to the read-only operations the Ramp Developer API
    actually exposes. Every step spells out its request inline so the flow can
    be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: rampApi
  url: ../openapi/ramp-developer-api-openapi.yml
  type: openapi
workflows:
- workflowId: flag-large-transaction
  summary: Branch into a transaction detail lookup only when the first transaction exceeds a threshold.
  description: >-
    Lists transactions in a date window and conditionally retrieves the full
    record of the first transaction when its amount is above the threshold.
  inputs:
    type: object
    required:
    - fromDate
    - toDate
    - threshold
    properties:
      accessToken:
        type: string
        description: OAuth2 client-credentials bearer token with the transactions:read scope.
      fromDate:
        type: string
        format: date
        description: Inclusive lower bound for the transaction window (YYYY-MM-DD).
      toDate:
        type: string
        format: date
        description: Inclusive upper bound for the transaction window (YYYY-MM-DD).
      threshold:
        type: number
        description: Amount above which the first transaction is treated as large.
  steps:
  - stepId: listTransactions
    description: >-
      List transactions for the date window and capture the first
      transaction's id and amount for the threshold comparison.
    operationId: listTransactions
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: from_date
      in: query
      value: $inputs.fromDate
    - name: to_date
      in: query
      value: $inputs.toDate
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstTransactionId: $response.body#/data/0/id
      firstAmount: $response.body#/data/0/amount
    onSuccess:
    - name: isLarge
      type: goto
      stepId: getLargeTransaction
      criteria:
      - context: $response.body
        condition: $.data[0].amount > $inputs.threshold
        type: jsonpath
    - name: isSmall
      type: end
      criteria:
      - context: $response.body
        condition: $.data[0].amount <= $inputs.threshold
        type: jsonpath
  - stepId: getLargeTransaction
    description: >-
      Retrieve the full record of the first transaction because its amount
      exceeded the supplied threshold.
    operationId: getTransaction
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: id
      in: path
      value: $steps.listTransactions.outputs.firstTransactionId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      transactionId: $response.body#/id
      amount: $response.body#/amount
      merchantName: $response.body#/merchant_name
      cardId: $response.body#/card_id
      userId: $response.body#/user_id
  outputs:
    flaggedTransactionId: $steps.getLargeTransaction.outputs.transactionId
    flaggedAmount: $steps.getLargeTransaction.outputs.amount
    flaggedMerchant: $steps.getLargeTransaction.outputs.merchantName