Understanding Variables in Tasks
Learn how to use variables in Mnemosyne Doppelganger tasks for dynamic automation, including default values and API usage.
Variables in Mnemosyne Doppelganger allow you to make your tasks dynamic and reusable. They are placeholders that can be inserted into task blocks, extraction scripts, or API payloads.
Syntax#
Variables are referenced using curly braces, for example:
{$varname}
varnameis the name of your variable- Can be used in any field that accepts text input
- Supports defaults for testing
Example with a default:
https://example.com/search?q={$query}
Using Variables in API Requests#
When executing tasks via the live API, variables can be passed in the request body:
{
"variables": {
"query": "iphone",
"category": "smartphones"
}
}
- Keys correspond to variable names used in your task
- Values are injected at runtime
- Enables fully dynamic automation without modifying task definitions
Best Practices#
- Always provide meaningful defaults for testing
- Keep variable names descriptive and consistent
- Use variables to parameterize URLs, search queries, or form inputs
- Combine variables with extraction scripts for flexible data processing
Example Usage#
Search Task#
- Navigate to
https://www.example.com/search?q={$query} - The
queryvariable determines the search term dynamically
Agent Task#
- Fill forms or click buttons using variables:
{$username},{$password} - Allows reuse of the same task across multiple accounts or inputs
Variables are a core part of making your tasks flexible, modular, and ready for integration into orchestration platforms like n8n.