Skip to main content

Explicit Dependencies

In Rumour, explicit dependencies are declared inside a Consumer's Request Node using the [dependencies] TOML block. This block tells the execution engine which upstream Producer nodes must be executed first, and which extracted variables the Consumer expects to receive.

Syntax Formats​

Rumour supports two distinct syntax formats for defining dependencies depending on your specific use-case.

The Map format is the most concise way to declare dependencies. It uses a standard TOML dictionary where the key is the path to the producer file, and the value is the variable name (or a list of variable names) you wish to extract.

[dependencies]
# Extract a single variable
"../../producer/requests/producer_node.toml" = "token"

# Extract multiple variables from the same producer
"../../producer/requests/producer_node.toml" = ["token", "user_id"]

2. The List Format​

For users who prefer explicitly typed arrays or need to attach future metadata to a specific dependency declaration, the List format using TOML's array-of-tables syntax ([[dependencies]]) is available.

[[dependencies]]
producer_id = "../../producer/requests/producer_node.toml"
consumer_var = "token"

[[dependencies]]
producer_id = "../../producer/requests/producer_node.toml"
consumer_var = "user_id"
note

Both formats are functionally identical under the hood. The Map format is highly recommended for readability.

Execution Trace Example​

When a Consumer declares a dependency, Rumour guarantees that the Producer will be executed before the Consumer is allowed to run.

In this example, our consumer relies on a producer node to generate an authorization token. Watch how the Rumour engine naturally waits for producer_node.toml to finish before executing consumer_node.toml:

# producer_node.toml
[request]
method = "POST"
url = "{{base_url}}/post"

[body]
type = "json"
raw = '{"session_token": "abc_123_xyz"}'

[extract]
token = "json.session_token"
# consumer_node.toml
[dependencies]
"../../producer/requests/producer_node.toml" = "token"

[request]
method = "GET"
url = "{{base_url}}/headers"

[headers]
Authorization = "Bearer {{token}}"
rumour run dependency_example/consumer/requests/consumer_node.toml -tv
POST https://httpbin.org/post
URL: https://httpbin.org/post
Body (json): {"session_token": "abc_123_xyz"}
✓ SUCCESS: /home/bugsfounder/workspace/testing/dependency_example/producer/requests/producer_node.toml (2347ms)

GET https://httpbin.org/headers
Header: Authorization: Bearer abc_123_xyz
URL: https://httpbin.org/headers
✓ SUCCESS: /home/bugsfounder/workspace/testing/dependency_example/consumer/requests/consumer_node.toml (785ms)
✓ dependency_example/consumer/requests/consumer_node.toml → PASS (2 Pass, 0 Fail, 0 Skip)
╭──────────────────────────────────────────────────────────────────────────╮
│ RUMOUR EXECUTION REPORT │
├──────────────────────────────────────────────────────────────────────────┤
│ Total Requests: 2 │
│ Successful: 2 │
│ Failed: 0 │
│ Skipped: 0 │
│ Success Rate: 100.0% │
│ Total Time: 3140ms │
╰──────────────────────────────────────────────────────────────────────────╯

✓ Successful Requests:
- /home/bugsfounder/workspace/testing/dependency_example/producer/requests/producer_node.toml [200] [2353ms]
- /home/bugsfounder/workspace/testing/dependency_example/consumer/requests/consumer_node.toml [200] [787ms]

Actionable Recommendations:
→ Run with --json to export this report for your CI/CD pipeline.

Notice how the consumer_node.toml correctly injects the abc_123_xyz token into its Authorization header after waiting for the upstream producer.