Skip to main content

Create a scenario

Create with a natural language prompt. Arga generates the seed config.
const scenario = await client.scenarios.create({
  name: 'E-commerce checkout',
  prompt: 'A Stripe account with 3 customers on different plans',
  description: 'For testing checkout flows',  // optional
  tags: ['checkout', 'stripe'],               // optional
});
Or create with an explicit seed config:
const scenario = await client.scenarios.create({
  name: 'Support channel',
  twins: ['slack'],
  seedConfig: {
    slack: {
      channels: [{ name: 'support', messages: ['Help needed'] }],
    },
  },
});

List scenarios

// All scenarios
const scenarios = await client.scenarios.list();

// Filter by twin or tag
const stripeScenarios = await client.scenarios.list({ twin: 'stripe' });
const checkoutScenarios = await client.scenarios.list({ tag: 'checkout' });

Get a scenario

const scenario = await client.scenarios.get('scenario-id');
console.log(scenario.name, scenario.twins, scenario.seedConfig);

Use a scenario when provisioning twins

Use a saved scenario to seed a short-lived twin session:
const { runId } = await client.twins.provision({
  twins: ['stripe', 'slack'],
  scenarioId: 'scenario-id',
});

const status = await client.twins.getStatus(runId);
if (status.status === 'ready') {
  for (const [name, twin] of Object.entries(status.twins)) {
    console.log(`${name}: ${twin.baseUrl}`);
    console.log(`  Admin: ${twin.adminUrl}`);
    console.log(`  Env vars:`, twin.envVars);
  }
}
The current TypeScript SDK exposes scenario CRUD plus seeded twin provisioning through client.twins.provision({ scenarioId: ... }). Long-lived per-scenario twin environment helpers are not part of the current SDK surface.