public function persistNode(array $answers, $node_type, $pattern = null, $attributes = [])
    {
        foreach ($answers as $index => $answer) {
            if (isset($answer['type']) && isset($answer['content']) && is_callable($answer['content'])) {
                $answer['content'] = is_string($answer['content']) ? $answer['content'] : $this->serializer->serialize($answer['content']);
            }
            $answers[$index] = $answer;
        }

        $this->current_node = Storage::addNode($answers, $node_type, $pattern, $attributes);

        return $this->current_node;
    }