import CodeBlock from "@theme/CodeBlock";
import SimpleSequentialChainExample from "@examples/chains/simple_sequential_chain.ts";
import SequentialChainExample from "@examples/chains/sequential_chain.ts";

## `SimpleSequentialChain`

Let's start with the simplest possible case which is `SimpleSequentialChain`.

An `SimpleSequentialChain` is a chain that allows you to join multiple single-input/single-output chains into one chain.

The example below shows a sample usecase. In the first step, given a title, a synopsis of a play is generated. In the second step, based on the generated synopsis, a review of the play is generated.

<CodeBlock language="typescript">{SimpleSequentialChainExample}</CodeBlock>

## `SequentialChain`

More advanced scenario useful when you have multiple chains that have more than one input or ouput keys.

Unlike for `SimpleSequentialChain`, outputs from all previous chains will be available to the next chain.

<CodeBlock language="typescript">{SequentialChainExample}</CodeBlock>
