input: from typing import Dict, List
  
  def chatbot_conversation(initial_state: Dict, states: List[Dict]) -> List[str]:
      """ Simulate a conversation with a chatbot based on predefined states and transitions.
      The chatbot starts at the given initial state and follows user inputs to switch between states.
      The conversation ends when a terminal state is reached.
      >>> initial_state = {'name': 'state0', 'message': 'Hello! How can I help you?', 'replies': {'I need some advice': 'state1', 'Can you answer my questions?': 'state2'}}
      >>> states = [
      ... {'name': 'state1', 'message': 'Sure, what kind of advice do you need?', 'replies': {'Career advice': 'state3','Health advice': 'state4'}},
      ... {'name': 'state2', 'message': 'Yes, I'll do my best! What do you want to know?', 'replies': {'Where can I find good tutorials': 'state5', 'Why is coding so hard': 'state6'}},
      ... {'name': 'state5', 'message': 'You can find tutorials online or join coding communities to get help from experienced coders. StackOverflow and Cod Academy are great resources.', 'replies': {}}
      ... ]
      >>> chatbot_conversation(initial_state, states)
      ['Hello! How can I help you?', 'Can you answer my questions?', 'Yes, I'll do my best! What do you want to know?', 'Where can I find good tutorials', 'You can find tutorials online or join coding communities to get help from experienced coders. StackOverflow and Cod Academy are great resources.', 'Goodbye!']
      """
output:     conversation = []
      current_state = initial_state
      conversation.append(current_state['message'])
      
      while current_state['replies']:
          user_input = list(current_state['replies'].keys())[0]
          conversation.append(user_input)
          next_state_name = current_state['replies'][user_input]
          
          for state in states:
              if state['name'] == next_state_name:
                  current_state = state
                  break
          
          conversation.append(current_state['message'])
      
      conversation.append('Goodbye!')
      return conversation